Open alvarosanchez opened 3 years ago
Thread on the topic https://twitter.com/andreasmanner/status/1438245716330225666?s=21
One for your queue @melix
Hi @graemerocher, how about this enhancement? I cannot see this in micronaut-projects/micronaut-maven-plugin
It's obviously not done, this issue is still open.
It seems there hasn't been a huge interest from the community in having this
I would be very interested in this and would be happy to help contribute this feature.
For background I recently discovered that after migrating from Spring Boot to Micronaut, our containerized applications were using a fraction of the container’s memory because of Paketo’s memory calculation was more intelligent about setting up sensible defaults for a cloud native application.
@jjathman what Java version are you using? Since JDK 10 (and JDK 8u191) the JVM will auto-detect the memory limits of the container. See https://bugs.openjdk.org/browse/JDK-8146115
@alvarosanchez the JVM does detect the memory size correctly as you noted, it’s just very conservative about max heap size because there’s no way for it to know if you have anything else running in the container. But practically speaking the only thing running is the single app, so it should use basically all of the memory it gets from its container.
What I’d like to see is this behavior that we get from our Spring Boot applications: https://paketo.io/docs/reference/java-reference/#memory-calculator
I think this is a reasonable ask that perhaps could be implemented regardless of the Buildpack support.
Agreed, definitely not necessary to use build packs to get a more reasonable set of memory defaults for a single application container scenario. The way I "solved" this for myself was by adding:
args.set(['-XX:MaxRAMPercentage=75', '-XX:InitialRAMPercentage=75'])
I think there could be even higher settings that are reasonable, but this was pretty good.
https://paketo.io/ https://buildpacks.io/