I'm using a tomcat:8 inside docker. This are some important settings (default).
$ java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
Picked up JAVA_TOOL_OPTIONS: -Duser.home=/home/jboss -Duser.name=jboss
intx CompilerThreadStackSize = 0 {pd product}
uintx ErgoHeapSizeLimit = 0 {product}
uintx HeapSizePerGCThread = 87241520 {product}
uintx InitialHeapSize := 33554432 {product}
uintx LargePageHeapSizeThreshold = 134217728 {product}
uintx MaxHeapSize := 524288000 {product}
intx ThreadStackSize = 1024 {pd product}
intx VMThreadStackSize = 1024 {pd product}
Now I need to increase the max heapsize because I get some problems with outofmemory
issues. (The applications are pretty heavy).
Before it goes out of memory it's warning me that the max heapsize is nearly reached and that the tomcat will go outofmemory
. A few minutes later it's crashing.
Inside my tomcat are a couple of .war
's deployed.
The apps are in /deployments/xxx.war
.
ls
shows me
app1_0.1
app1_0.1.war
app2_0.1
app2_0.1.war
...
Now my question is the following. Do I have to increase the heapsize for every .war file seperatly or for the whole tomcat at the same moment.
Because I don't find a command to check the heapsize on one java application but when I want to increase the heapsize I only seem to find command like this: java -Xms16m -Xmx64m ClassName
(so on one specific application).
When I just execute it without specifying an app:
$ java -Xms16m -Xmx64m
Picked up JAVA_TOOL_OPTIONS: -Duser.home=/home/jboss -Duser.name=jboss
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server,
because you are running on a server-class machine.
...