我在Ruby应用程序中调试内存泄漏( Ruby 2.1.2 )。在收集独角兽主过程的GC统计数据的同时,我发现了主要的&次要GC计数没有变化。以下是GC统计数据示例:
{:count => 273,:heap_used => 10181,:heap_length => 12252,:heap_increment => 2071,:heap_live_slot => 4113806,:heap_free_slot => 35946,:heap_final_slot =&gt ; 0 ,: heap_swept_slot => 655582,:heap_eden_page_length => 10181,:heap_tomb_page_length => 0,:total_allocated_object => 132076290,:total_freed_object => 127962484,:malloc_increase => 164098552,:malloc_limit => 30949538,:minor_gc_count => 260,:major_gc_count => 13 ,:remembered_shady_object => 19831,:remembered_shady_object_limit => 29756,:old_object => 699918,:old_object_limit => 1069156 ,:oldmalloc_increase => 185902224,:oldmalloc_limit => 58937052}
大约7个小时后:
{:count => 273,:heap_used => 23353,:heap_length => 39695, :heap_increment => 16342,:heap_live_slot => 9482797, :heap_free_slot => 35840,:heap_final_slot => 0,:heap_swept_slot => 655582, :heap_eden_page_length => 23353,:heap_tomb_page_length => 0, :total_allocated_object => 137445281,:total_freed_object => 127962484, :malloc_increase => 663823560,:malloc_limit => 30949538, :minor_gc_count => 260,:major_gc_count => 13 , :remembered_shady_object => 19831, :remembered_shady_object_limit => 29756,:old_object => 699918, :old_object_limit => 1069156,:oldmalloc_increase => 685627232, :oldmalloc_limit => 58937052}
根据我的理解,如果:oldmalloc_increase crosses:oldmalloc_limit则触发主要GC。此外,如果:malloc_increase交叉:malloc_limit将触发次要GC。
在我的情况下,oldmalloc_increase& malloc_increase超出限制仍未触发GC。
任何人都可以帮我解决以下问题: