Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Setting JVM Heap Size in Tomcat 5.5

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator

Originally posted by David Schectman:
Thanks for you help.


No problem, glad I could help.
-Ben
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!