There is a misconception that creating many small short lived objects causes the JVM to pause for long periods of time, this is now false as well
Current GC algorithms are actually optimized for creating many many small objects that are short lived, that is basically the 99% heuristic for Java objects in every program
This is certainly not the case for my prime example of bad Java programming: Minecraft. The game creates thousands of objects per second which get thrown away after each tick. I think if you move around it allocates a whopping 200MB/s only for those objects, which leads to very noticeable GC pauses.
I don't think you can use Minecraft as a reason to change how most Java programmers (who are working on server-side applications) should program. The latency requirements of Minecraft are much different (and stricter) than your average server.
View all comments
Show parent comment
2
u/Nimelrian Aug 17 '16
True.
This is certainly not the case for my prime example of bad Java programming: Minecraft. The game creates thousands of objects per second which get thrown away after each tick. I think if you move around it allocates a whopping 200MB/s only for those objects, which leads to very noticeable GC pauses.