do a full GC prior to getting stats

This commit is contained in:
Sam 2014-02-14 16:10:26 +11:00
parent b75620973f
commit 177371fb69
1 changed files with 7 additions and 0 deletions
app/controllers/admin

View File

@ -4,6 +4,13 @@ class Admin::DiagnosticsController < Admin::AdminController
def memory_stats
begin
# ruby 2.1
GC.start(full_mark: true)
rescue
GC.start
end
stats = GC.stat.map{|k,v| "#{k}: #{v}"}
counts = ObjectSpace.count_objects.map{|k,v| "#{k}: #{v}"}