JVM Configurations

Eric Dalquist at UW Madison has documented their work on tuning the JVM heap for uPortal uPortal Heap Tuning.

Who Hardware/Software JVM JVM Arguments
Unversity of Madison - Wisconsin Hardware Details
J2SE 1.6
# First option is env so it is visible in ps 
-Dmum.env=my-test

# Print computed flags after startup
-XX:+PrintCommandLineFlags

# Memory Configuration
-server -d64                   # switch to 64bit server mode
-Xms1024m                      # Set initial heap sizes
-Xmx5120m                      # Set max heap size
-XX:NewSize=512m               # Set initial new size to 1/2 the initial heap
-XX:MaxNewSize=2560m           # Specify the max new size, generally allow the JVM to use up to 1/2 the max heap
-XX:MaxGCPauseMillis=250       # GC Pauses up to 250ms aren't bad, have ergonomics try and keep pauses below this level 
-XX:+UseConcMarkSweepGC        # Force CMS for the collector
-XX:+CMSIncrementalMode        # Use incremental mode since minor CPU overhead is better than potential pauses
-XX:+UseAdaptiveSizePolicy     # Lets the JVM adjust the eden/tenured ratio
-XX:+UseAdaptiveGCBoundary     # Lets the JVM adjust the young/old ratio
-Dsun.rmi.dgc.client.gcInterval=0x7ffffffffffffffe   # disable explicit RMI GCs
-Dsun.rmi.dgc.server.gcInterval=0x7ffffffffffffffe   # disable explicit RMI GCs

# Enable perm-gen class unloading (needed with UseConcMarkSweepGC)
-XX:+CMSClassUnloadingEnabled

# Set a large enough perm gen
-XX:PermSize=300m
-XX:MaxPermSize=300m

# Use Multiple Page Size Support (Solaris 9+) w/4mb pages for the heap.
# Do not use with ISM as this replaces the need for ISM.
-XX:+UseMPSS

# Cache DNS lookups for 12 hours
-Dnetworkaddress.cache.ttl=43200

# debug and memory tweaks to avoid Hotspot Compiler Failure
#"-XX:+PrintCompilation
-XX:CodeCacheMinimumFreeSpace=2M
-XX:ReservedCodeCacheSize=64M
-XX:CompileCommandFile=/my/up/admin/bin/hotspot_compiler

# Enable JMX Remote Monitoring
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.password.file=/my/password
-Dcom.sun.management.jmxremote.access.file=/my/access

## Options used based on server start/stop script command line
# GC Logging
-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-XX:+PrintTenuringDistribution
-XX:+PrintAdaptiveSizePolicy
-XX:AdaptiveSizePolicyOutputInterval=1
-Xloggc:/my/up/logs/gc.log

# Classloading Logging
-verbose:class

# Debuging
-Xdebug
-Xrunjdwp:transport=dt_socket,address=7000,server=y,suspend=n
 
Texas Tech University
RHEL, Dual Intel(R) Xeon(TM) 3.20GHz CPU 1Gb Ram, Tomcat 5.0.28
Java HotSpot(TM) Client VM (1.5.0_04-b05 mixed mode) -Xms256m
-Xmx512m
-Xloggc:/usr/local/tomcat/logs/tomcat_gc.log
-Djava.awt.headless=true
-Dsun.net.client.defaultReadTimeout=600000
-Dsun.net.client.defaultConnectTimeout=120000
University of the West of England
Sun Fire V440, Solaris 8, 4 X 1284mghz, 16Gb Ram, Apache 2, Tomcat 5.0
J2se 1.4.2_06
-Djava.awt.headless=true
-Dsun.awt.font.advancecache=off
-Xmx3072m
Memorial University of Newfoundland Sun Fire 880, Solaris 8, 4 x CPUs - 750 MHz
8 GB RAM, Tomcat 5.0.27
J2SE 1.4.1-b21 -server
-Xms768m
-Xmx1280m
-XX:MaxNewSize=128m
-XX:NewSize=128m
-XX:SurvivorRatio=2
-XX:-UseConcMarkSweepGC
-XX:+UseParNewGC
XX:ParallelGCThreads=8
University of British Columbia Sun V440, SunOS 5.9, 4x1.3Hgz ?, 8Gb, Apache 2.0.55, Tomcat 5.5.7, mod_jk 1.2.15 1.5.0_06-b05 -DmyUBC=prod2
-XX:PermSize=24m
-XX:+DisableExplicitGC
-XX:MaxGCPauseMillis=3000
-verbose:gc
-Xloggc:gc.start.08-05-2006_03:58:04.log
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintTenuringDistribution
-Xmx1536m
-Xms1536m
-Dcom.sun.management.jmxremote
-Dorg.jasig.portal.jmxPort=1234
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.password.file=jmxremote.password
Rutgers University
4 x Sun Fire v240 2x1GHz 4 GB RAM, Solaris 8, Tomcat 5.0.28, Apache 1.3.33, mod_jk 1.3
1.5.0_05-b05 # Use server hotspot compiler
-server

# We set heap min/max to same size for consistent results
-Xms2048m
-Xmx2048m

# Since uP is temp object intensive, we set new area to half heap
-XX:NewSize=1024m
-XX:MaxNewSize=1024m

# There are two survivor spaces:
#    a SurvivorRatio of 5 to a 1GB new space will yield
#    two ~100MB survivor spaces (~800MB for eden)
-XX:SurvivorRatio=5

# Keep each survivor space about 90% full
-XX:TargetSurvivorRatio=90

# Copy object between survivor space at most 16 times
-XX:MaxTenuringThreshold=16

# PermSize controls area of heap for Class/Method objects;
#   Dynamic class loading/reflection (e.g., JSP) may require more space
#   Note that this space is ABOVE and beyond the min/max heap size
-XX:PermSize=32m

# Just in case; don't let app code impact GC (System.gc() noop)
-XX:+DisableExplicitGC

# Only one of our boxes runs with gc logging turned on
-verbose:gc 
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintHeapAtGC
-XX:+PrintTenuringDistribution

# Following young/old GC algorithms are default since JDK 1.5.0
#-XX:+UseParNewGC
#-XX:+UseConcMarkSweepGC

# LDAP connection pooling
-Dcom.sun.jndi.ldap.connect.pool.protocol=ssl
-Dcom.sun.jndi.ldap.connect.pool.timeout=30000
-Dcom.sun.jndi.ldap.connect.pool.prefsize=10
-Dcom.sun.jndi.ldap.connect.pool.maxsize=100

# Properties set by Tomcat/Catalina
-Djava.endorsed.dirs=/u01/app/tomcat/common/endorsed
-Dcatalina.base=/u01/app/tomcat
-Dcatalina.home=/u01/app/tomcat
-Djava.io.tmpdir=/u01/app/tomcat/temp

# Disclaimer: your actual mileage may vary. Tuning was
# done under JDK 1.4.2.x which uses different young/old
# GC algorithms.
The University of Manchester
6 x Dell PowerEdge 2850 running Tomcat on Debian Linux behind hardware load balancer using sticky sessions, 2 x Sun T2000 servers (High-Availability failover cluster) as database tier running MySQL 1.5.0_14
  1. Use server hotspot compiler
    JAVA_OPTS="$JAVA_OPTS -server"

    ## Logging
    # turn on some debug for GC only print the distribution when doing tuning
    JAVA_OPTS="$JAVA_OPTS -verbose:gc"
    JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCTimeStamps"
    JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails"
    JAVA_OPTS="$JAVA_OPTS -XX:+PrintTenuringDistribution"
    JAVA_OPTS="$JAVA_OPTS -Xloggc:/web/Logs/portal/gc.log"
    #JAVA_OPTS="$JAVA_OPTS -XX:+PrintCompilation"

    ## Garbage collection
    JAVA_OPTS="$JAVA_OPTS -XX:TargetSurvivorRatio=90"
    JAVA_OPTS="$JAVA_OPTS -XX:SurvivorRatio=5"
    JAVA_OPTS="$JAVA_OPTS -XX:MaxTenuringThreshold=12"
    JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC"
    JAVA_OPTS="$JAVA_OPTS -XX:+CMSIncrementalMode"
    JAVA_OPTS="$JAVA_OPTS -XX:+CMSIncrementalPacing"
    JAVA_OPTS="$JAVA_OPTS -XX:+CMSParallelRemarkEnabled"
    JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
    JAVA_OPTS="$JAVA_OPTS -XX:+CMSClassUnloadingEnabled"
    JAVA_OPTS="$JAVA_OPTS -XX:+CMSPermGenSweepingEnabled"
    JAVA_OPTS="$JAVA_OPTS -XX:+UseTLAB"

    ## Non Heap memory
    JAVA_OPTS="$JAVA_OPTS -XX:PermSize=128m"
    JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=256m"
    JAVA_OPTS="$JAVA_OPTS -XX:CodeCacheMinimumFreeSpace=8m"
    JAVA_OPTS="$JAVA_OPTS -XX:ReservedCodeCacheSize=128m"
    ## Heap memory
    # We set heap min/max to same size for consistent results
    JAVA_OPTS="$JAVA_OPTS -Xms2048m"
    JAVA_OPTS="$JAVA_OPTS -Xmx2048m"
    # Since uP is temp object intensive, we set new area to half heap
    JAVA_OPTS="$JAVA_OPTS -XX:NewSize=1024m"
    JAVA_OPTS="$JAVA_OPTS -XX:MaxNewSize=1024m"
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.