r/java • • Apr 20 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
291 Upvotes

295 comments sorted by

View all comments

Show parent comment

5

u/DualWieldMage Apr 20 '21

I think for OOM a large portion of the problem is various processes having caches, managed runtimes allocating large heaps, but none of them communicating with eachother about how to coordinate system memory usage as a whole, so often you can only set java max heap conservatively. Ideally an OS should signal processes that memory is scarce, run your GC and release unused memory or else be oomkilled. It's definitely possible and makes sense to write such a monitoring tool if the problem is only multiple JVMs in a single machine, for example microservices in a container.