openjdk-runtime icon indicating copy to clipboard operation
openjdk-runtime copied to clipboard

Added MAX_HEAP_SIZE_MB to avoid a calculated size being too large

Open gregw opened this issue 5 years ago • 2 comments

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 avatar Apr 30 '19 09:04 gregw

@gregw Why is setting HEAP_SIZE_MB directly or adjusting the ratio not sufficient?

meltsufin avatar Apr 30 '19 13:04 meltsufin

@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.

gregw avatar May 01 '19 06:05 gregw