January 13, 2004

Unable to Connect to JRun

Yesterday was good day, on one of our CFMX 6.1 servers, every two hours all cold fusion pages returned with the error unable to connect to JRUN. The Cold Fusion Application Server Service wouldn’t restart, and we would have to reboot the machine.

In looking at the jrun logs in cf_root\runtime\logs, there was the error java.lang.OutOfMemoryError. And not much more information.

Because this happened suddenly, and there were no changes to the server. It was a perplexing situation. After successfully ruling out other options, we determined it had to do with the configuration settings of the JVM.

In, cf_root\runtime\bin\jvm.config, the default settings are
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -Xbootclasspath/a:"{application.home}/../lib/webchartsJava2D.jar" -XX:MaxPermSize=128m -XX:+UseParallelGC -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS

Or Can be seen in the CF Administrator under the Java and JVM.
-server -Dsun.io.useCanonCaches=false -Xbootclasspath/a:"{application.home}/../lib/webchartsJava2D.jar" -XX:MaxPermSize=128m -XX:+UseParallelGC

The problem turned out to be with the heap memory size.

In the Java Virtual Machine, the Heap Layout is in three sections:


  • Young generation who’s purpose is to hold newly created objects.

  • Old generation that contains long withstanding objects.

  • Permanent generation which stores class objects.


The total size of the young generation and old generation is manipulated by the –Xmx in the Jvm.config file or Maximum JVM Heap Size in the CF Administrator. In CF, this setting translates into initiated objects and the time in memory they are. (Remember it also includes the CFMX Application and any programming classes you have initiated)

The size of the permanent generation is manipulated by the –XX:MaxPermSize switch. For CF what this means is that this switch size has to be larger than the size of the all of the compiled web page classes.

If you think you are in a similar situation, I would recommend adding the following debugging settings to the JVM arguments, and restart the server. These arguments will help you to see the settings of the above, and if you are close or nearby in the values.

-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails

Reference:
Tuning Garbage Collection with the 1.4.2 Java[tm] Virtual Machine
Turbo-charging Java HotSpot Virtual Machine, v1.4.x to Improve the Performance and Scalability of Application Servers

Posted by Elyse at January 13, 2004 5:22 AM | TrackBack
Comments
Post a comment









Remember personal info?