Solved

Tomcat - setenv.bat

Posted on 2013-05-13
6
3,874 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse java  build path 6 57
Arrays.asList  VS  ArrayList 4 59
check java version using powershell 13 92
jsp login check 12 31
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

770 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