chetanmeh commented on issue #74: Dynamically setting the JVM memory limit by 
reading the Cgroup
URL: 
https://github.com/apache/openwhisk-runtime-java/pull/74#issuecomment-524178152
 
 
   @mrutkows Currently the java runtime uses openj9 instead of openjdk
   
   
https://github.com/apache/openwhisk-runtime-java/blob/a8e666f7b38d533192fce897342037f4ca570a41/core/java8/Dockerfile#L18
   
   Open J9 does not support `-XX:+UseCGroupMemoryLimitForHeap` and instead has 
a different flag  [UseContainerSupport][1]. This flag is enabled by default in 
Docker base images we use in OpenWhisk
   
   ```
   $ docker run --rm -m 1g openwhisk/java8action /bin/bash -c 'echo 
$JAVA_TOOL_OPTIONS'
   -XX:+IgnoreUnrecognizedVMOptions -XX:+UseContainerSupport 
-XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle
   ```
   
   See also [this blog post][2].
   
   Also j9 does not support `-XX:+PrintFlagsFinal` instead provides [few 
different flags to get the defaults][3]
   
   So I believe we are good here and do not need to explicitly specify memory 
settings for build version we are using
   
   [1]: https://www.eclipse.org/openj9/docs/xxusecontainersupport/
   [2]: 
https://royvanrijn.com/blog/2018/05/java-and-docker-memory-limits/#test-6-openj9-nightly
   [3]: https://github.com/eclipse/openj9/issues/527#issuecomment-497003442

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to