DEV Community

Discussion on: Cables vs. malloc_trim, or yet another Ruby memory usage benchmark

Collapse
 
palkan_tula profile image
Vladimir Dementyev

I wonder what would happen if the malloc_trim was run, say every 100 GC's?

Yeah, that's something I was thinking about, too. Maybe, more sophisticated approach could be more efficient (either calling every N full cycles or depending on the number of allocated pages or whatever).

So, maybe, the best option would be to add GC.trim and let users decide when to call it (the same way it's proposed for GC.compact).