Description
Describe the issue
We are having a similar issue as to what is detailed in #10499. We too are using the latest JDK 21 CE version of GraalVM with a Spring application, and are noticing that the -Xmx
and -Xms
arguments aren't working as expected.
We are otherwise not using any other options and rely on the defaults with the final command being ./application -Xmx512m -Xms512m
When building the image we are using the following arguments for the native-image tool itself:
--gc=serial
--static
--libc=musl
Steps to reproduce the issue
Please include both build steps as well as run steps
- Build native image
- Run native image using options -Xmx512m and -Xms512m
Describe GraalVM and your environment:
- GraalVM version: https://github.com/graalvm/graalvm-ce-builds/releases/tag/jdk-21.0.2
- JDK major version: 21
- OS: Debian
- Architecture: AMD64
More details
Screenshot of the metrics provided by Spring actuator metrics detailing the max and committed bytes
Actual
Given a max and min heap size of 512m, the compiled application states it can use a maximum of 526.5 MB (14.5 more than expected) and the total memory allocated to the process is ignored and is instead dynamically allocated based on the memory it needs.
Expected
Given the same max and min heap. When the application starts it should be able to use a maximum of 512MB and have 512MB already allocated to the process.