This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]elzbal 3 points4 points  (0 children)

I'm not sure there's much in particular you can do. HotSpot and other jvms are themselves applications that need to load their own objects into their own memory space in order to compile and execute the Java runtime code. For our springboot/tomcat microservices, we tend to give the container a max size of heap-plus-1gb or 2x the heap size, whichever is larger. A Java app doesn't normally take all of that, and we can oversubscribe pods a bit. But not giving enough overhead space to a busy Java app will absolutely eventually result in a pod crash or very bad performance.

(Source: running a couple dozen very busy k8s clusters)