?
Solved

Tomcat - setenv.bat

Posted on 2013-05-13
6
Medium Priority
?
5,170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

 
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 36

Accepted Solution

by:
mccarl earned 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

801 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