[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: JAVA_MAX_MEM_RATIO greater than 60%



Can you run the app with enough memory and check process memory usage from `oc rsh`? Perhaps it will give more insight.

The container is not running a separate OS. It is just the process you are starting within that container and the libraries it loads. And any additional processes it spawns. So standard memory profiling techniques should apply within the container.

I know that people are looking at ways to decrease java footprint for small apps. You know the java modularization effort. graalvm as another example. Presently situation is not ideal for such use cases IMO. I trust that things will improve over time though.

Karl Nicholas wrote on 06/13/18 00:19:
I’m messing around with*JAVA_MAX_MEM_RATIO* to see about saving on memory. With every setting I also adjust the container memory so that I get the following JVM parameters.

exec java -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties -Xms512m -Xmx512m -XX:+UseParallelGC -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=256m -XX:ParallelGCThreads=2 -Djava.util.concurrent.ForkJoinPool.common.parallelism=2 -XX:CICompilerCount=2 -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/opinions-web-swarm.jar

The “*Xms512m -Xmx512m*” are, to me, the important ones. So, if I set the *container memory to 1Gb and the JAVA_MAX_MEM_RATIO to 50% *(the default), then I get the above JVM settings and my application works fine.

If I set the *container memory to 854Mb and the JAVA_MAX_MEM_RATIO to 60%*, then I get the above settings and my application, so far, works fine.

If I set the *container memory to 732Mb and the JAVA_MAX_MEM_RATIO to 70%*, then I get the above JVM settings and my application *CRASHES.*

So, something outside the JVM needs more 732-512 or 220Mb (and less than 342, I’m guessing 256?) of memory to run the JVM? Does the OS inside need that much? The image is a wildfly-11-swarm image with EJB/JSF/REST and a few things built inside of openjdk18-openshift:latest image.

Is there some way to configure or know how much the openjdk18-openshift redhat supplied image needs for memory outside of the JVM settings? Should I look into rebuilding it myself if I need to control the memory usage?

Thanks.



_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]