Configure java memory of tomcat
search cancel

Configure java memory of tomcat

book

Article ID: 373160

calendar_today

Updated On:

Products

Continuous Delivery Director

Issue/Introduction

How to configure java memory for tomcat ?

Environment

Continuous Delivery Director 8.x

Resolution

Example for Minimum memory 2048M and Maximum memory 4096M

On Linux :

  1. Create (or update if it already exists) a file setenv.sh under <apache_tomcat_dir>/bin containing :
    export CATALINA_OPTS="-Xms2048M -Xmx4096M"


    And add executable permissions :
    chmod +x setenv.sh

  2. Restart tomcat :
    ./shutdown.sh
    ./startup.sh


In catalina.out following lines appears :

17-Jun-2024 15:01:28.012 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms2048M
17-Jun-2024 15:01:28.012 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx4096M

 

On Windows :

For Windows the file to create is setenv.bat with this line :
 
set CATALINA_OPTS="-Xms2048M -Xmx4096M"