最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Why is the MaxHeapSize of my Java app in a Kubernetes container 20GB less than I had expected? - Stack Overflow

matteradmin6PV0评论

I have a Tomcat container with a memory request of 62000Mi. The JAVA_OPTS environment variable contains -XX:InitialRAMPercentage=50.0 and -XX:MaxRAMPercentage=80.0.

I was expecting the MaxHeapSize to be 80% of the memory request so ~50GB however the actual MaxHeapSize is ~30GB so I am missing ~20GB.

What could be the reason(s) that I don't get the expected MaxHeapSize? Is it feasible to use MaxRAMPercentage on Kubernetes, or should I stick to Xmx?

This is on Java 11. The Kubernetes worker node has 64GB memory and is hosted on VMWare with dynamic memory allocation.

Post a comment

comment list (0)

  1. No comments so far