News for hackers. Stuff that matters.
Re:Malloc envy by haimez on Monday April 04, 2016 @05:55PM (#11426042)
It's true, because the time to free objects is not related to the number of objects freed- it IS dependent on the number of objects that AREN'T freed. The GC time (in a very general sense) is the amount of time it takes to traverse the live object graph.
Re:Malloc envy by albinofrenchy on Monday April 04, 2016 @08:17PM (#11426845)
Isn't that true only for objects in the 'new' pool? Or does it actually compact the old pool every gc?
Re:Malloc envy by haimez on Monday April 04, 2016 @08:34PM (#11426918)
I'm not sure I see the connection you're trying to make. The specifics of old pool vs new pool (generation is the preferred term) are dependent on the GC config, but in no case can you find memory that can be freed by traversing a "dead objects" graph. Liveness is what drives the relationship between size and computation time. Big O notation stuff.
Re:Malloc envy by albinofrenchy on Monday April 04, 2016 @10:04PM (#11427274)
So my understanding of the new generation is that it's essentially a giant chunk of continuous memory and as you create new objects, you are just adding to the end of it. For whatever reason a GC event happens, and now you can traverse the live graph, and anything alive in the new generation gets copied to the old generation partition of memory. And now you just reset the counter for the new object pool, and voila, you've deleted a whole bunch of young objects just by not copying them.

But once it's in the old generation, you run right into the same issue with fragmentation and having to keep track of where deleted objects are so you can reuse that space. If the idea is that you just keep doing memcopies for all the live objects to reuse the space and avoid looking at dead objects, I'd think that that is it's own performance issue?

Re:Malloc envy by cha5m on Monday April 04, 2016 @09:03PM (#11427043)
Why is this the case?