mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
do a full GC prior to getting stats
This commit is contained in:
@ -4,6 +4,13 @@ class Admin::DiagnosticsController < Admin::AdminController
|
|||||||
|
|
||||||
def memory_stats
|
def memory_stats
|
||||||
|
|
||||||
|
begin
|
||||||
|
# ruby 2.1
|
||||||
|
GC.start(full_mark: true)
|
||||||
|
rescue
|
||||||
|
GC.start
|
||||||
|
end
|
||||||
|
|
||||||
stats = GC.stat.map{|k,v| "#{k}: #{v}"}
|
stats = GC.stat.map{|k,v| "#{k}: #{v}"}
|
||||||
counts = ObjectSpace.count_objects.map{|k,v| "#{k}: #{v}"}
|
counts = ObjectSpace.count_objects.map{|k,v| "#{k}: #{v}"}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user