apache / openwhisk-runtime-java

Apache OpenWhisk Runtime Java supports Apache OpenWhisk functions written in Java and other JVM-hosted languages
https://openwhisk.apache.org/
Apache License 2.0
46 stars 63 forks source link

JVM heap size is not set correctly for Java actions #5

Open rabbah opened 6 years ago

rabbah commented 6 years ago

@rabbah commented on Thu Jun 15 2017

Java actions run with no heap settings, regardless of the container's memory limit: https://github.com/apache/incubator-openwhisk/blob/master/core/javaAction/Dockerfile#L38

This will cause a reused Java action to eventually be killed because the GC may not get a chance to run.

>  docker run -m 64M -it javaaction bash
# java -XX:+PrintFlagsFinal -version 2>&1 | grep MaxHeapSize
    uintx MaxHeapSize                              := 1035993088                          {product}

That's ~1GB even though memory limit for container is 64M.


@jsanda commented on Mon Oct 23 2017

Is something like this what you have in mind? run-java.sh is the default command for the image. Among other things it sets the JVM heap size based on container limits.

rabbah commented 6 years ago

@jsanda thanks for the link; def. looks like what we need.

@andrewnet FYI I moved the issue here where it is best addressed.

sven-lange-last commented 5 years ago

Addressed by #95. Also see #77

Can we close this issue?