Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Jdk8u131+ and 9 support detecting cpu and memory limits to set heap and core usage.

https://blogs.oracle.com/java-platform-group/java-se-support...



We tried those flags in the beginning since it was introduced in docker openjdk image[1].

When we dug in further, we find its just not trouble free (i.e. experimental). The default is to use 1/4th of RAM which is entirely inefficient [2]. The "MaxRAMFraction" parameter allows to specify 1/n fraction and not possible to efficiently use 65% or 75% of memory. The only place to start is to set MaxRAMFraction=2 and that already means only 50% of memory is used for heap. That produces a lot of wastage. A lot of resource efficiency is gained by starting with 65% or 80%.

OpenJDK 10 is introducing a new option "MaxRAMPercentage" [3] and that goes closer to making a script unnecessary.

TL;DR - The default flags are still experimental in JDK 8/9, and deemed to be better on Java 10. A script is just better for consistency.

1: https://github.com/docker-library/docs/pull/900

2: https://news.ycombinator.com/item?id=16636544

3: https://bugs.openjdk.java.net/browse/JDK-8186248




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: