Some really useful looking flags suggested here
http://blog.headius.com/2009/01/my-favorite-hotspot-jvm-flags.html
-XX:OnOutOfMemoryError="mail -s 'OOM on
`hostname` at `date`'
whoever(a)example.com <<< ''" as a way to send out email when
there's an
OutOfMemoryError. Poor-man's monitoring!
-XX:+HeapDumpOnOutOfMemoryError
-XX:+PrintCompilation prints out the name of each Java method Hotspot
decides to JIT compile. The list will usually show a
bunch of core Java
class methods initially, and then turn to methods in your application. In
JRuby, it eventually starts to show Ruby methods as well.
-XX:+PrintGCDetails includes the data from -verbose:gc but also adds
information about the size of the new generation and
more accurate timings.
-XX:+TraceClassLoading and -XX:+TraceClassUnloading print information class
loads and unloads. Useful for investigating if you
have a class leak or if
old classes (like JITed Ruby methods in JRuby) are getting collected or not.
Trying this out on Xwiki 2.0M2 gives some interesting, voluminous results:
http://nielsmayer.com/xwiki-catalina-with-PrintGCDetails-PrintCompilation-T…
I notice a huge amount of "loading" happening regarding jPython!! -- this
seems excessive to have Xwiki "out of box" loading up jPython when Groovy
and Velocity are "built in."
And it appears all this loading is for the "{{code}}" macro. Seems like it
would be lighter-weight (esp for high-volume situations) to use Javascript
in the browser for highlighting code (Bespin?) instead of on the server
requiring a whole extra scripting language. Alternately, is there a way of
having jython only load when the {{code}} macro is used in a document, and
then, only when language=java, html, or xml but not language=none?? Seems
like that would be a big performance win right there.
[Loaded org.xwiki.rendering.parser.HighlightParser from
file:/usr/java/xe-20m2/WEB-INF/lib/xwiki-core-rendering-macro-code-2.0-milestone-2.jar]
[Loaded org.xwiki.rendering.parser.AbstractHighlightParser from
file:/usr/java/xe-20m2/WEB-INF/lib/xwiki-core-rendering-macro-code-2.0-milestone-2.jar]
[Loaded org.xwiki.rendering.internal.parser.pygments.PygmentsParser from
file:/usr/java/xe-20m2/WEB-INF/lib/xwiki-core-rendering-macro-code-2.0-milestone-2.jar]
[Loaded org.python.core.PyObject from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PySequence from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyBaseString from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyString from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyUnicode from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.xwiki.rendering.parser.Syntax from
file:/usr/java/xe-20m2/WEB-INF/lib/xwiki-core-rendering-api-2.0-milestone-2.jar]
[Loaded org.python.util.PythonInterpreter from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
...
[Loaded org.xwiki.rendering.macro.box.BoxMacroParameters from
file:/usr/java/xe-20m2/WEB-INF/lib/xwiki-core-rendering-macro-box-2.0-milestone-2.jar]
[Loaded org.xwiki.rendering.macro.code.CodeMacroParameters from
file:/usr/java/xe-20m2/WEB-INF/lib/xwiki-core-rendering-macro-code-2.0-milestone-2.jar]
[Loaded $Proxy28 from org.apache.catalina.loader.WebappClassLoader]
[Loaded org.python.core.PyException from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyCode from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyFile from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyFileWriter from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyStringMap from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.PyModule from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.CompilerFlags from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.core.CodeFlag from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
[Loaded org.python.Version from
file:/usr/java/xe-20m2/WEB-INF/lib/jython-standalone-2.5.0-xwiki.jar]
...
This is with the following flags:
tomcat 24048 4.2 28.7 1784472 554800 ? Sl 16:29 1:46
/usr/java/default/bin/java -server -Xms160m -Xmx1024m -XX:PermSize=160m
-XX:MaxPermSize=320m -XX:+DoEscapeAnalysis -XX:+UseBiasedLocking
-XX:+AggressiveOpts -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintCompilation
-XX:+PrintGCDetails -XX:+TraceClassLoading -XX:+TraceClassUnloading
-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
-DjavaEncoding=UTF-8 -Djava.awt.headless=true -Djava.library.path=/usr/lib64
-classpath
:/usr/share/tomcat6/bin/bootstrap.jar:/usr/share/tomcat6/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar
-Dcatalina.base=/usr/share/tomcat6 -Dcatalina.home=/usr/share/tomcat6
-Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat6/temp
-Djava.util.logging.config.file=/usr/share/tomcat6/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
org.apache.catalina.startup.Bootstrap start
Niels
http://nielsmayer.com
PS: I also tried out the promising-sounding
"-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC". It still segfaults.
Hopefully, they'll get it right in JDK 7:
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x00007f15ca60653a, pid=23777, tid=139729915439440
# JRE version: 6.0_14-b08
# Java VM: Java HotSpot(TM) 64-Bit Server VM (14.0-b16 mixed mode
linux-amd64 )
# Problematic frame:
# V [libjvm.so+0x19c53a]