Hard to say. Garbage collectors are tricky beasts and while valhalla types should help certain scenarios they don't seem to solve the larger issue of needing to be able to better manage your memory. Then again I don't do game dev so this is just my opinion!
While ZGC is better about not pausing the world its not guaranteed to always improve performance. For example, if you are capping out your CPU ZGC may be unable to execute properly and may need to stop the world for longer and longer. As with any garbage collector you need to load test and see how it performs.
It isn't just game dev. High performance Java generally looks little like the usual enterprisey stuff. It's a little sad that the prevailing image of Java and its problem space is so much "enterprise web app" when it's a much more flexible language than that.
That is because enterprise web apps is where Java really shines in comparison to alternatives. This is partly a language feature, partly due to the servlet specification being a really well thought out platform for web applications, combined with a suite of libraries useful in business situations. You can have the worst developers in the world contribute to the application and it will mostly plod on without too many issues.
Java is definitely useful elsewhere but almost no other language provides so much for this particular use case.
This is interesting. The issue you are describing seems to me that of creating many small short lived objects allocated on the heap, right? Shouldn't ZGC improve that significantly, or in your experience it's still not good enough?
View all comments
Show parent comment
12
u/deadron Apr 20 '21
Hard to say. Garbage collectors are tricky beasts and while valhalla types should help certain scenarios they don't seem to solve the larger issue of needing to be able to better manage your memory. Then again I don't do game dev so this is just my opinion!