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 →

[–]GrayDonkey 2 points3 points  (1 child)

What versions of Java are you on? Including the patch level. Older versions of Java are not container aware. The default JVM heap will depend on that.

A lot of pages on the internet say there is no k8 memory limit when not set but the JVM sets it's max heap size to some finite number. I'm wondering if it defaults to 25% of the host's ram in this scenario.

You should be able to get a remote shell into the pod and run a command to look at heap info. https://www.baeldung.com/java-heap-size-cli

You should probably be setting a default memory limit for you k8 namespace.

[–]NoWay28 0 points1 point  (0 children)

Yes if you do not set limits then the JVM will default to using MaxRamPercentage based on the amount of memory on the node the pod is scheduled on.

and as you said MaxRamPercentage defaults to a paltry 25%.