Quantcast
Channel: Crunchify
Viewing all articles
Browse latest Browse all 1037

How to Increase Apache Tomcat HeapSize (JVM Heap) in Eclipse IDE (integrated development environment) to Avoid OutOfMemory

$
0
0

It’s common to get OutOfMemory while running heavy loaded application in Eclipse IDE. Recently while running Apache Tomcat under Eclipse for one of the web application I was getting Java Heap memory related error java.lang.OutOfMemoryError .

What needs to be done here basically is to increase the jvm heap size. So for increasing the JVM Heap Size of Tomcat in Eclipse we have to set few VM arguments of the tomcat.

Follow these simple steps to change the Heap Size of Tomcat under Eclipse. If you have below questions then you are at right place

Let’s get started

Step-1

Step-2

Click on “Open launch configuration” link.

Open Tomcat Launch Configuration in Eclipse IDE - Crunchify Tips

Step-3

  • Go to Arguments Tab and Add below parameter as per your need.
  • -Xms512m -Xmx2048m
  • Click Apply and OK

Change Tomcat Startup JVM Configuration in Eclipse IDE

Step-4

  • Start Tomcat Server and look for log in Console Output
  • You should see tomcat server started with mentioned parameters

Apache Tomcat Server Started with Xmx and Xms parameter in Eclipse

Extra Tips:

Following are few options available to change Heap Size.

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size
-Xss<size>        set java thread stack size

In addition, you could set minimum heap to 512MB and maximum heap 2048MB for any Java program let’s say sample – HelloWorld.

java -Xms512m -Xmx2048m HelloWorld

Have a suggestion or anything to add to this article? Chime in and share as a comment OR post it in forum.

The post How to Increase Apache Tomcat HeapSize (JVM Heap) in Eclipse IDE (integrated development environment) to Avoid OutOfMemory appeared first on Crunchify.
Author: App Shah

Viewing all articles
Browse latest Browse all 1037

Trending Articles