• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Setting JVM Heap Size in Tomcat 5.5

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I installed version 5.5 and java 1.5 on a system running windows server 2003 with 1.5G of RAM. I created a system environment variable JAVA_OPTS = -Xms128m -Xmx512m to set the initial heap size to 128M and the maximum to 512M. After creating the variable, I restarted the tomcat service. Despite this, my servlet is running out of memory. I added code to the init method to log the total memory and free memory available to the JVM

Total memory 6.6650112E7
Free memory 2.2165176E7

The total memory indicates that it is still set to 64M. How do I increase it?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is tomcat installed as a windows service?
If so, it's not paying attention to the environment variables.

If you installed the start menu items click:
Start->Programs->Apache Tomcat->Tomcat Configuration.

There is a Tab for Java settings. There are two field for memory settings.
 
David Schectman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the information.

Yes, it is installed as a windows service.

C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe" //RS//Tomcat5

When I click on the start menu option to configure tomcat (or the one to monitor tomcat), I get the message "an instance of 'tomcat5' application is already running". I tried stopping the server and I get the same message.

Can I configure these in a tomcat config file or only by the configuration program?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They're stored in the registry.

You're not trying to start Tomcat from that screen, are you?
Just click on the 'Java' tab and fill out the fields for initial memory pool and maximum memory pool.
 
David Schectman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for you help. Problem solved. There was a tomcat administration process (not application) already running. How it was statred, I do not know. After stopping this process, I could get to the admin screen to configure the memory. I restarted the tomct service and it works
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David Schectman:
Thanks for you help.


No problem, glad I could help.
-Ben
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic