How to Increase JVM Memory for Tomcat on ubuntu 20.04 LTS

Apache Tomcat is broadly utilized Web Container on the planet. Exceptionally enormous organizations run on Apache Tomcat now a days. There are many different options like IBM WebSphere, Geronimo, IIS, and so on however Tomcat is my #1 one as well.

It’s exceptionally basic for us to design every right boundary while running your application in Production climate or even being developed env.

In this instructional exercise we will go over strides on the best way to design – Xms, – Xmx and – XX:PermSize an incentive for Tomcat worker. How about we initially comprehend not many terms. 

In this post, We will increase the Tomcat’s JVM memory on Ubuntu 20.04 LTS

Step 1: Open Tomcat Service File

To configure tomcat need to edit and replace the memory for JVM in Tomcat

sudo nano /etc/systemd/system/tomcat.service

Step 2: Change or Increase the JVM Size

Find out the Environment line and change or increase the JVM memory for apache tomcat.

Environment='CATALINA_OPTS=-Xms712M -Xmx1224M -server -XX:+UseParallelGC'

Save and exit from your text editor.

Step 3: Reload The Daemon

We have made changes in tomcat’s service config file, We required to reload the daemon first, Execute the below command for the same.

sudo systemctl daemon-reload

Step 4: Restart The Tomcat Service

We need to restart the Apache tomcat service to get new changes, Use the following command for the same.

sudo systemctl restart tomcat.service

Step 5: Get The Tomcat Service

Get the Apache tomcat’s service status to check and find new changes for JVM in logs, Use the following command  for the same.

sudo systemctl status tomcat.service

To get the new changes you need to find tomcat’s logs, Where you can get the JVM new size, As per your changes.

Conclusion

We have successfully Increase JVM Memory for Tomcat on ubuntu 20.04 LTS, Kindly report in case you are facing defeculties with follwing details.

  • OS name
  • OS version
  • Package name
  • Logs – Error / Warning / failed

Get in touch with our new devops tools based website- https://www.devopstricks.in/

How to Increase JVM Memory for Tomcat on ubuntu 20.04 LTS

5 thoughts on “How to Increase JVM Memory for Tomcat on ubuntu 20.04 LTS

  1. Since the admin of this web page is working, no doubt very quickly
    it will be famous, due to its feature contents.

  2. Usually I don’t learn article onn blogs, however I would like
    to say that this write-up very forced me to check oout and ddo so!
    Your writing style haas been amazed me. Thank you,
    very great article.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top