Solved

Tomcat - setenv.bat

Posted on 2013-05-13
6
4,075 Views
Last Modified: 2013-05-14
I have deployed an application in Tomcat which results in the below error when server starts.

java.land.OutOfMemoryError: GC Overhead limit exceeded

I create a setenv.bat file in bin directory of Tomcat with the following

set JAVA_OPTS=-Xms1024m -Xmx2048m -XX:MaxPermSize=512m
exit /b 0

but this does not help.

Is there a way to find out if the file is getting called and JAVA_OPTS getting set? The documentation of the war file says that this much memory should be sufficient, so I feel it may not even be getting set.

Thank you
0
Comment
Question by:ank5
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 39161757
You can set that at the command line yourself and then start Tomcat, but it must be said that if you have a fundamental memory leak in your app, it probably doesn't matter how large you set the heap - you'll still run out off memory
0
 
LVL 12

Expert Comment

by:basav_com
ID: 39161803
Use jvisualvm or anyother profiling tool and see how much memory your application is taking up..
0
 
LVL 1

Author Comment

by:ank5
ID: 39161816
Thanks for your reply.

This is a war file which is shipped as a part of the product so I think there wouldn't be memory leaks in the app. Also, I have not yet started using the application, restart just after deployment results in this problem.

I'm starting the Tomcat instance from Wndows Services and not through command prompt. Will setting JAVA_OPTS through command prompt still have a effect?
0
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
LVL 21

Expert Comment

by:Amitkumar Panchal
ID: 39161827
it may possible that setenv.bat file is not called by catalina.bat.

Check by setting JAVA_OPTS variable in catalina.bat.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39161994
Will setting JAVA_OPTS through command prompt still have a effect?
Yes

Don't forget to stop the service instance first
0
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39163478
If Tomcat was installed as a service via the installer, you should be able to configure these setting from the service wrapper's property pages. If you have a "Tomcat" folder in your Start Menu->Programs that contains the "Configure Tomcat" shortcut, then check out the screen shot below. Note, the initial and max memory sizes can be set in their own dedicated textbox but the MaxPermSize can just be set in the "Java Options" area.

"Configure Tomcat" screenshot
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question