I have a java-11 tomcat-9 stack app service. I want to setup xmx (max heap memory) to that.
How can I set that?
Sidepoints
- I went to ssh and tried
printenv | grep JAVA
but I could not find anything. However it prints following line in logs, that means it is taking it from somewhere but not printing it. Am I looking at wrong place?
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMEDPicked up
JAVA_TOOL_OPTIONS: -Xmx4878M -Djava.net.preferIPv4Stack=true -javaagent:/agents/java/applicationinsights-agent-codeless.jar
- Also, if I set, I need to make sure the default things (like javaagent) does not get overriten otherwise I would lose out other default necessary things (like app insights)
Apparently just put
JAVA_OPTS
-Xmx10G
and you are done, it does not override the original variables.