Webmapping Social Change Online
News | FAQs | Contacts  
    WebMap Composer Product Home
Home Support FAQs

How do I change the memory allocated to the Tomcat container?

Applies to JDK 1.3.1

You may need to alter the default memory allocation to improve throughput for high concurrent loads:

On "Unix"

Edit the file $TOMCAT_HOME/bin/startup.sh and insert or alter the lines below, subsituting for the desired value, eg:

Bourne shell

CATALINA_OPTS="-Xmx(max heap)m"; export CATALINA_OPTS

Set this to at least 128 megabytes, eg -Xmx128m

On Windows:

Edit the file $TOMCAT_HOME\bin\startup.bat and insert or alter the line below, subsituting for the desired values:

set CATALINA_OPTS="-Xmx(max heap)m"

Set max heap to at least 128 megabytes, eg -Xmx128m

Discourse

  • Xmx

Xmx sets the maximum heap size for the Java Virtual Machine. On Solaris it apparently defaults to 64m (megabytes), which is way too small for WMC.

  • XX:MaxPermSize

usage: CATALINA_OPTS="-Xmx(max heap)m -XX:MaxPermSize=128m"

This parameter is optional, we have found -Xmx to be suficient.

"For most applications the permanent generation is not relevant to GC performance. However, some applications dynamically generate and load many classes. For instance, some implementations of JSPs do this. If necessary, the maximum permanent generation size can be increased with MaxPermSize." (from "Tuning Garbage Collection" quoted below).

For more information please see http://java.sun.com/docs/hotspot/index.html, in particular, the article titled "Tuning Garbage Collection
with the 1.3.1 JavaTM Virtual Machine"

See the discussion below for a discussion of total heap size, snipped from http://forum.java.sun.com/thread.jsp?forum=27&thread=343789&tstart=0&trange=15


Ray,

Thank you for the insight.

I confirmed your findings that the original information

TimCramer: For 1.3 here's the formula:
TotalHeapSize = -Xmx setting + MaxPermSize

would have been correct if written as

TotalHeapSize = -Xmx setting + (PermSize with MaxPermSize)

  • or -
TotalHeapSize = -Xmx setting + PermSize

It appears that PermSize and not MaxPermSize is what
adds to the heap size.

  • ** Using Tim Cramers original formula ***
  • ms512m -mx512m -XX:MaxPermSize=64m
pmap output: total Kb 551968

  • Xms512m -Xmx512m -XX:MaxPermSize=128m
pmap output: total Kb 551992

  • Xms512m -Xmx512m -XX:MaxPermSize=256m
pmap output: total Kb 552040

  • ** Using Rays modification to Cramers formula ***
  • ms512m -mx512m -XX:PermSize=64m -XX:MaxPermSize=64m
pmap output: total Kb 616720

  • Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m
pmap output: total Kb 682536

  • Xms512m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m
pmap output: total Kb 814168

  • ** Using PermSize ***
  • ms512m -mx512m -XX:PermSize=64m
pmap output: total Kb 616720

  • Xms512m -Xmx512m -XX:PermSize=128m
pmap output: total Kb 682536

  • Xms512m -Xmx512m -XX:PermSize=256m
pmap output: total Kb 814168


Sort Support FAQs by Subject | Date

  Support:  WMC Home  |  Product Docs  |  Presentations  |  Showcase  |  Release Docs  |  Download  |  FAQs  

top of page

© Social Change Online Pty Ltd, Australia
email: webmap@socialchange.net
URL: http://webmap.socialchange.net