• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Where is -XX:MaxPermSize=128m option to Tomcat's JVM options in Windows?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As in the title. I need to add -XX:MaxPermSize=128m but have no clue where in Windows. Is there any configuration file or it goes to the Java tab in Tomcat configuration? (in the tray)
along with this:

-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 6.0
-Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 6.0
-Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 6.0\endorsed
-Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\logging.properties
-XX:MaxPermSize=128m

Is this correct?

T.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Tom!

For most Tomcat configurations, you don't set all that stuff up on the command line. Instead, you create an executable "SETENV.BAT" file in the TOMCAT_HOME\bin directory that contains environment SET statements (specifically, SET JAVA_OPTS="....."). This keeps you from having to modify (and maintain) the primary CATALINA.BAT file that runs Tomcat.

I'm not sure, but I think 128M is the default PermGenSpace value. In any event, PermGen space goes away completely in Java 8, so it's no longer a problem at that point.
 
Tom Trochanowski
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thank you for a quick answer but I am confused ;-( I deal with Tomcat6

I have got:

C:\Program Files\Apache Software Foundation\Tomcat 6.0
and here

-bin
bootstrap.jar
Tomcat6.exe
Tomcat6w.exe
tomcat-juli.jar
-conf
-Catalina
- -localhost
manager.xml
probe.xml

catalina.policy
catalina.properties
context.xml
logging.properties
server.xml
tomcat-users.xml
web.xml

-lib
-logs
-temp
-webapps
-work
LICENSE
NOTICE
tomcat.ico
Uninstall.exe

So where should I add the memory limitation? and how?

Tom
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I said. You have to create an executable SETENV.BAT file under Tomcat's bin directory. This file doesn't exist until you create one (Linux/Unix use setenv.sh, instead).

Its contents would typically be something like:
 
Tom Trochanowski
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

This is very clear now. Two last questions.

1. Is there any other configuration I should include in the file?
2. Is there any way to test it?

Tom
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most people don't need a SETENV at all. Although one of its more common usages in recent years has been to override PermGen defaults, since a lot of webapps - especially those using an ORM - need more than the defaults. Then again, as I said, Java 8 eliminates PermGen entirely.

Usually, you'll find out if your PermGen settings are effective pretty quickly. Especially if you "hot deploy" a webapp several times. I believe the jprofiler tool might list what's in effect, though.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your tomcat is running as windows service you can change the configuration using the following command:

tomcat/bin# tomcatw7.exe //ES//<servicename>

It displays the configuration, go to java tab and add the configurations.

restart the service.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic