This is currently demonstrated on my playground app, visiting it results in a 500, works now having deployed the fix given in the answer.
The error is was:
Processing by GcController#show as HTML
Completed 500 Internal Server Error in 0ms
NoMethodError (undefined method `stat' for GC:Module):
app/controllers/gc_controller.rb:4:in `show'
Conversely if you grab the Rails app from Github.
Then RAILS_ENV=production rails server and go to /.
You’ll get:
{:count=>131, :heap_used=>193, :heap_length=>345, :heap_increment=>152, :heap_live_num=>127915, :heap_free_num=>29930, :heap_final_num=>0}
Is it safe to assume Heroku is using a patched GC?
Has anyone else encountered this? There doesn’t appear to be any documentation about it.
I’m seeing some conflicting memory usage behaviour locally vs on Heroku, which is why I’m trying to GC.stat. I wonder if the differences could be accounted for by patched GC.
I also opened a Heroku issue for this.
Answer graciously stolen from JD at Heroku: