When would you use this garbage collection method in your Ruby program(s)?
GC.start
There are occasions when it's necessary to kick it off, but usually it works fine by itself. I've had situations where an app will chew through 1GB of memory if left unchecked, pushing deep into swap, where triggering GC.start
intermittently will cut that to 100MB.
The trouble is that calling this method is very expensive and can slow down your application considerably if used aggressively.