我们有一个heroku应用程序。当我早上检查
据我理解,这应该是垃圾收集器完成小扫描的次数,所以第二天上升是有道理的,但为什么会下降呢?
GC.stat
时,GC.stat[:minor_gc_count]
为51。当天晚些时候它变成了50。据我理解,这应该是垃圾收集器完成小扫描的次数,所以第二天上升是有道理的,但为什么会下降呢?
>heroku run rails c --remote production
Running rails c on ⬢ ... up, run.2287 (Standard-1X)
Loading production environment (Rails 5.2.2.1)
irb(main):001:0> GC.stat
=> {:count=>63, :heap_allocated_pages=>1753, :heap_sorted_length=>1753, :heap_allocatable_pages=>0, :heap_available_slots=>714528, :heap_live_slots=>713742, :heap_free_slots=>786, :heap_final_slots=>0, :heap_marked_slots=>471239, :heap_eden_pages=>1753, :heap_tomb_pages=>0, :total_allocated_pages=>1753, :total_freed_pages=>0, :total_allocated_objects=>2802530, :total_freed_objects=>2088788, :malloc_increase_bytes=>65256, :malloc_increase_bytes_limit=>32225676, :minor_gc_count=>51, :major_gc_count=>12, :remembered_wb_unprotected_objects=>4626, :remembered_wb_unprotected_objects_limit=>8538, :old_objects=>458044, :old_objects_limit=>838856, :oldmalloc_increase_bytes=>65712, :oldmalloc_increase_bytes_limit=>19737900}
irb(main):002:0> exit
**Airbrake: closed
>heroku run rails c --remote production
Running rails c on ⬢... up, run.7226 (Standard-1X)
Loading production environment (Rails 5.2.2.1)
irb(main):001:0> GC.stat
=> {:count=>62, :heap_allocated_pages=>1618, :heap_sorted_length=>1913, :heap_allocatable_pages=>295, :heap_available_slots=>659511, :heap_live_slots=>659395, :heap_free_slots=>116, :heap_final_slots=>0, :heap_marked_slots=>467961, :heap_eden_pages=>1618, :heap_tomb_pages=>0, :total_allocated_pages=>1618, :total_freed_pages=>0, :total_allocated_objects=>2726093, :total_freed_objects=>2066698, :malloc_increase_bytes=>5662240, :malloc_increase_bytes_limit=>24780563, :minor_gc_count=>50, :major_gc_count=>12, :remembered_wb_unprotected_objects=>4632, :remembered_wb_unprotected_objects_limit=>9262, :old_objects=>456572, :old_objects_limit=>913146, :oldmalloc_increase_bytes=>7549584, :oldmalloc_increase_bytes_limit=>19737900}
major_gc_count
也开始出现这种情况。通常是12,但有时会变成13,然后又回到12。今天minor_gc_count
也达到了49。 - Marlin Pierce