openjdk-runtime
openjdk-runtime copied to clipboard
Added MAX_HEAP_SIZE_MB to avoid a calculated size being too large
When deployed on systems with large available memory, the automatic calculated heap size may be too large for the JVM. This PR applies a limit to the calculated heap size.
@gregw Why is setting HEAP_SIZE_MB
directly or adjusting the ratio not sufficient?
@meltsufin I think the image should work out of the box on all reasonable containers. Currently I can't even build on a machine with 32GB because the tests fail because they try to start a JVM with a too large heap. If we are setting the heap size by heuristics, then those heuristics should always result in a legal sensible heap size. Overriding values should only be needed if you want a very specific configuration.
edit: for example the jetty-runtime tests are failing on my machine with a too large heap, so I manually set a heap size of 4096, which then breaks on the CI machines as too large for them.