Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to ensure Tomcat picking setenv.bat configuration  RSS feed

 
Vic Suyam
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the following error "java.lang.OutOfMemoryError: PermGen space" in our production Tomcat 6.0.18, which running in windows 2003 server with 4GB of RAM. with all references for that error, I updated setenv.bat with the following entry
set "JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -server".
But i am still facing the issue and i am not sure how to ensure whether tomcat pick that configuration or not?  Please guide me on this, Thanks in advance.

Below is my Catalina.bat file entry
rem Get standard environment variables
if "%CATALINA_BASE%" == "" goto gotSetenvHome
if exist "%CATALINA_BASE%\bin\setenv.bat" call "%CATALINA_BASE%\bin\setenv.bat"
goto gotSetenvBase
:gotSetenvHome
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
:gotSetenvBase
 
Tim Holloway
Bartender
Posts: 18504
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setenv script is just an ordinary batch file, so you could check by putting an "echo" statement in it and starting Tomcat from the console. The echo statement should print either on the console or in catalina.out (or maybe both).

There is no setenv.bat (or for Unix-style OS's just "setenv") pre-supplied with Tomcat, so you have to add one if you need it. It will automatically execute when you run the catalina.bat script if it is found - provided that its file access rights allow it to be executed by the Tomcat userid!
 
Vic Suyam
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim, bad luck i could not find catalina.out in my configuration, can I configure catalina.out manually? or any other way to track "JAVA_OPTS" value?
 
Tim Holloway
Bartender
Posts: 18504
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The catalina.out file is simply a redirection of the stdout/stderr streams from Tomcat's JVM. Not all Tomcat configurations create one, but when they do, it's normally located in Tomcat's "log" directory.

The catalina.out file records JVM startup messages as well as stuff like deployment of webapps, contains stack traces from uncaught application exceptions, etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!