Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This could be due to the "Lazy Sweeping" feature in Ruby 1.9.3 and above. </p> <p>Lazy sweeping basically means that, during garbage collection, Ruby only "sweeps" away enough objects to create space for the new objects it needs to create. It does this because, while the Ruby garbage collector runs, nothing else does. This is known as "Stop the world" garbage collection. </p> <p>Essentially, lazy sweeping reduces the time that Ruby needs to "stop the world." You can read more about lazy sweeping <a href="http://books.google.com/books?id=P7AdAgAAQBAJ&amp;pg=PA300&amp;lpg=PA300&amp;dq=mri+lazy+sweeping+algorithm&amp;source=bl&amp;ots=K0OoJZdZE3&amp;sig=MTahTJG7qLbhExHGmoyjJt4RKqE&amp;hl=en&amp;sa=X&amp;ei=heqfUp6aIZGCyAGF6oCoBQ&amp;ved=0CDcQ6AEwAQ#v=onepage&amp;q=mri%20lazy%20sweeping%20algorithm&amp;f=false" rel="noreferrer">here</a>.</p> <p>What does your <code>RUBY_GC_MALLOC_LIMIT</code> environment variable look like?</p> <p>Here is an excerpt from <a href="http://samsaffron.com/archive/2013/11/22/demystifying-the-ruby-gc" rel="noreferrer">Sam Saffron's blog</a> concerning lazy sweeping and the RUBY_GC_MALLOC_LIMIT:</p> <blockquote> <p>The GC in Ruby 2.0 comes in 2 different flavors. We have a "full" GC that runs after we allocate more than our malloc_limit and a lazy sweep (partial GC) that will run if we ever run out of free slots in our heaps.</p> <p>The lazy sweep takes less time than a full GC, however only performs a partial GC. It's goal is to perform a short GC more frequently thus increasing overall throughput. The world stops, but for less time.</p> <p>The malloc_limit is set to 8MB out of the box, you can raise it by setting the RUBY_GC_MALLOC_LIMIT higher. </p> </blockquote> <p>Is your <code>RUBY_GC_MALLOC_LIMIT</code> extremely high? Mine is set to 100000000 (100MB). The Default is around 8MB, but for rails apps they recommend it to be quite a bit higher. If yours is too high it could be preventing Ruby from deleting garbage objects, because it thinks it has plenty of room to grow. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload