zalando-stups / docker-openjdk

DEPRECATED: Docker image with OpenJDK and Zalando CA
21 stars 14 forks source link

Also set 'initial heap-size' in 'java-dynamic-memory-opts' #6

Open jbellmann opened 8 years ago

jbellmann commented 8 years ago

While the 'max heap-size' is set to a higher value than default, the 'initial heap-size' is not and leads to be very low (16M). This can result in OOME during startups. I would say that half of 'max heap-size' would be a good default.

LappleApple commented 7 years ago

@jbellmann Hey, can we close this issue?

nmeyer-zalando commented 6 years ago

I think it makes more sense setting it equal to -Xmx so the memory allocation in the OS stays the same during garbage collection. This will

hjacobs commented 6 years ago

@nmeyer-zalando I think the answer is "it depends", see burstable vs. guaranteed pods on Kubernetes --- some system configurations might benefit from overcommitting and relying on the fact that apps only use a fraction of the heap usually. Some other apps with high traffic and performance characteristics benefit from min==max setting.

nmeyer-zalando commented 6 years ago

Generally the JVM doesn't tend to yield memory back to the OS very easily unless configured to aggressively do so. Oracle usually recommends using -Xms == -Xmx, I agree that it depends but it makes for a sensible default, to be overridden with env vars.