Closed tariqajyusuf closed 9 months ago
This is a per user/per application setting that you'll need to add but we can't add this for everyone.
Can you elaborate more on what you mean by having this a per-container setting? Most JDK containers are running a single Java application. By default the JVM will only use 25% of the available memory. If the entire container is for a JVM, creating a 1GB container means that the JVM will not use more than 256MB. It doesn’t make a lot of sense for every JDK image user to have default 25% max utilization of their image.
https://learn.microsoft.com/en-us/azure/developer/java/containers/kubernetes?source=recommendations for reference - the JVM ergonomics are dynamic and should ideally be set by the user for their workload.
Got it, it feels like this should be a default change instead of requiring two different configurations that are often going to be the same.
With this practice, it may be worth considering including documentation in adaptium's docker README. I tested a number of well used JVM based images that don't set this so I suspect this is a setting that a lot of people are not aware of.
separately Microsoft is working on improving ergonomics profiles for containers - see https://github.com/microsoft/openjdk-proposals/blob/main/ergonomics_profiles/readme.md
The JVM by default uses only 25% of the system memory. In a container environment we should have this larger so that the system doesn't necessarily go through memory thrash despite most of the allocated memory still being available.