JVM Configurations

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

Some additional recommended settings:

# Set timeout values to something long (especially the ReadTimeout where you may wait on a long SQL or WebServices response)
# to insure a thread doesn't wait indefinitely on a bad network connection.
-Dsun.net.client.defaultConnectTimeout=20000 -Dsun.net.client.defaultReadTimeout=240000

Other observations:

  • uPortal creates a large number of transient objects.  There is a definite advantage to having a larger heap, say 4GB as a baseline setting (meaning you'd probably want around a 6 - 8 GB RAM machine though if you go with 6GB insure the OS is not paging with heavy load).  I'd recommend 5GB heap with an 8GB machine.  uPortal can run with as low as 2GB heap, but there are much more frequent full garbage collections and it definitely impacts uPortal's ability to handle larger numbers of users logging in during a short period of time and user response thereof.
  • There is also an advantage especially with a larger heap (4GB+) to having new generation heap size to around 1/2 of overall heap size rather than the JDK 1.6/1.7 default sizing of around 1/3.  With a smaller heap, it is probably better to have the larger tenured heap size to reduce the frequency of full GC cycles.
  • CMS collector is very helpful to reducing the duration of full GC cycles.  Performance testing generally shows a slight increase in CPU usage so it is generally worth it to avoid long (5+ second) pause times for full GC operations.  If the machines are generally CPU bound, the tradeoff is not so clear (though we'd generally recommend adding another machine or carefully looking at your portlet and portal caching if heavily CPU bound).

 

Who

Hardware/Software

JVM

JVM Arguments

Unversity of Madison - Wisconsin

Hardware Details

J2SE 1.7

trying to get to Java 8

Last updated here: 2016-07-12

# First option is env so it is visible in ps
-Dmum.env=my-test

# Memory Configuration
-server -d64                   # switch to 64bit server mode
-Xmx4g                         # Set max heap size
-XX:MaxGCPauseMillis=300       # GC Pauses up to 250ms aren't bad, have ergonomics try and keep pauses below this level
-XX:+UseG1GC                   # use G1GC as garbage collection aglorithm


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

# Cache DNS lookups but not too long
-Dnetworkaddress.cache.ttl=3600

# memory tweaks to avoid Hotspot Compiler Failure
-XX:ReservedCodeCacheSize=128M

# Log garbage collection
-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-XX:+PrintAdaptiveSizePolicy
-Xloggc:/my/up/logs/gc.log
 
Göteborg University developed by LDC, Lund UniversityIntel(R) Xeon(R) CPU X6550  4 cores @ 2.00GHz 12Gb RAMjava version 1.7.0_17

-Xms2G
-Xmx2G
-XX:PermSize=350m
-XX:MaxPermSize=700m
-XX:+UseCompressedOops
-XX:+CMSClassUnloadingEnabled
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC

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"

University of Victoria, B.C.

RHEL 5_64, Dell PowerEdge r710, dual Intel(R) Xeon(R) CPU X5650 @ 2.76GHz (12 cores total), 24GB Ram, Tomcat 6.0.29

1.6.0_18

Java Hotspot (TM) 64-Bit Server VM (build 16.0-b13, mixed mode)

-server                                                                         
-Xms1024m
-Xmx5120m
-XX:NewSize=512m
-XX:MaxNewSize=2560m
-XX:MaxGCPauseMillis=250
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:SurvivorRatio=5
-XX:TargetSurvivorRatio=90
-XX:MaxTenuringThreshold=12
-Dsun.rmi.dgc.client.gcInterval=0x7ffffffffffffffe
-Dsun.rmi.dgc.server.gcInterval=0x7ffffffffffffffe
-XX:+CMSClassUnloadingEnabled
-XX:PermSize=300m
-XX:MaxPermSize=300m·
-XX:+PrintCommandLineFlags
-Dnetworkaddress.cache.ttl=3600