4 ms·
From OP: "There are huge amounts of objects which are allocated and discarded milliseconds later." Any mature generational GC should handle this with literally
by gchpaco 12y ago
From OP: "There are huge amounts of objects which are allocated and discarded milliseconds later."
Any mature generational GC should handle this with literally zero overhead. Assuming it is not doing a nursery gc every millisecond, all those objects should die in the nursery almost immediately. It has been well understood for at least twenty years how to do that in O(live objects), and the JVM has for all its many faults a very good garbage collector. So I am quite skeptical. This is also at odds with empirical evidence which is that going from 1.7 to 1.8 with the same world improves framerate.
Now the JVM gc has about a million tuning parameters and most hardcore Minecrafters have a witches brew of tuning that they run with. It's far from impossible that those tuning parameters are totally inappropriate with 1.8. But the GC should handle this fine.
- collinvandyck76 12y agoSo, the nursery is a certain size. If you are filling it up continually you're going to be spending a lot of time managing it. Not only that, but if your rate of allocation is high enough you might inadvertently promote a number of objects that have not gone out of scope yet to the tenured section which in a less demanding allocation scenario could have been collected from the nursery.
- x0x0 12y agonursery gc should be very fast, particularly if most objects die; this issue sounds like it needs more investigation also, it sounds like the devs should be doing some testing on typical user machines, instead of higher powered dev boxes
- Skinney 12y agoNursery gc on my machine (Macbook Air 2013) is 10ms.
- gchpaco 12y agoNursery gc is proportional to the size of the live object set (here alleged to be 0) plus a constant overhead. It's not a simple thing to benchmark.
- Skinney 12y agoLive memory 25Mb in my case, sorry, kinda important number to mention :P
- TheLoneWolfling 12y agoSo, what you're saying is that in order to keep 60FPS consistantly you need to cram the entire rest of the frame into 6.7ms? (That's an equivalent of running at 150FPS "normally".) People forget how sensitive framerate is to seemingly minor amounts of time. (Even if you have a target of 30FPS (please don't!), that's still an effective target of 43FPS.)
- fiatmoney 12y agoYou still have to trace the object graph - it's not "zero overhead" unless the escape analysis can determine that the object can be stack-allocated (and hence collected without tracing the graph).
- gchpaco 12y agoIf there are no live objects in the nursery, a Cheney-style collector copies nothing and is done. The modification to mark-and-sweep to make it O(live objects) similarly is a bit more sophisticated but routine among high performance GCs.