def log_gc_stats_on_request_end
return do_nothing_on_null(:log_gc_stats_on_request_end) if null?
GC_MUTEX.synchronize do
if OBJECT_SPACE_SUPPORTS_LIVE_OBJECTS
@transaction.message('Final objects on heap: ' \
"#{ObjectSpace.live_objects}")
end
if OBJECT_SPACE_SUPPORTS_ALLOCATED_OBJECTS
@transaction.message('Final objects allocated so far: ' \
"#{ObjectSpace.allocated_objects}")
elsif OBJECT_SPACE_SUPPORTS_COUNT_OBJECTS
count = ObjectSpace.count_objects
@transaction.message('Final objects allocated so far: ' \
"#{count[:TOTAL] - count[:FREE]}")
end
if GC_SUPPORTS_TIME
@transaction.message("Final GC time: #{GC.time}")
end
if GC_SUPPORTS_CLEAR_STATS
GC.clear_stats
end
end
end