Solved

Tomcat - setenv.bat

Posted on 2013-05-13
6
4,319 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 130
SHA2 certs for IIS AND Java? 2 122
spring maven example issues 3 44
Bitwise and to sum elements 2 17
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

730 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