In Windows, it’s quite easy to increase the memory by using the Tomcat Monitoring Application tomcat9w. You find the application in the following directory:
%CATALINA_HOME%\bin\tomcat9w.exe
A small dialog will open and you need to select the Java tab in the top. To increase the memory you need to change the value in the Maximum memory pool property. In the screenshot you can see, that I have changed the value to 4GB.
Increase the memory with additional options
Another way to increase memory is to create a setenv.sh for unix or setenv.bat for windows system in the %CATALINA_HOME%/bin folder.
# initial memory allocation
export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
# maximum memory allocation
export CATALINA_OPTS="$CATALINA_OPTS -Xmx8192m"
Check configuration
If you want to double check the configuration, you can use the jinfo command line tool from the running process. You need to go to the following directory and give the process id.
// Check settings
%JAVA_HOME%\bin\jinfo -flags PID
Tom
Hi
Great article. That was what I’m looking for.