문제

Why does Ruby MRI 2.1 define both RUBY_GC_OLDMALLOC_LIMIT and RUBY_GC_MALLOC_LIMIT? What is the difference?

도움이 되었습니까?

해결책

Here's a great resource to explain this concept.

In brief, the reason there are two MALLOC_LIMIT variables is that Ruby 2.1 has moved to a two-generation garbage collector. When the memory footprint of newer high-turnover objects on the heap reaches the RUBY_GC_MALLOC_LIMIT, it triggers a minor GC event; when the size of longer-lived objects reaches RUBY_GC_OLDMALLOC_LIMIT, a major GC event is triggered.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top