Aug 4 2008

Sun JVM 1.6 Heap Memory Behavior with ColdFusion Frameworks

Posted by Mike Brunt at 7:29 AM
7 comments
- Categories: ColdFusion | JRun-J2EE

I am pretty sure that dry title means that many will not read this post but it is fairly important.  We have worked with several clients who use ModelGlue/Mach-ii-ColdSpring-Reactor/Transfer as a triumvirate of co-working frameworks and each have had JVM memory problems.  There is a fairly healthy debate which advises the rolling back of the default JVM which comes with ColdFusion 8 when ModelGlue/Mach-ii-ColdSpring-Reactor/Transfer are used.  Sun 1.6, or 6 as it also known, is the default JVM with CF8 and many have rolled back to the Sun JVM 1.5 or 5.  This is because of the class loader behavior in the 1.6 JVM which can mean that the instantiation time for heavy applications can take a long time, some have reported this taking minutes.  This will supposedly be fixed when the latest beta of the 1.6 JVM is released. Our findings in several load tests with several clients show that the 1.6 JVM is more efficient over the ongoing application use, typically 15-20% more efficient.

There is another behavioral difference in the 1.6 JVM which is important to note.  We found that in all previous JVM's there was a default behavior which ran explicit Full Garbage Collections (Full GC's) every 60 seconds. It appears this is part of the Remote Method Invocation (RMI) mechanism.  As Full GC's cause the JVM to pause completely (know as stop-the-world events) too many Full GC's is not a good thing.  So in the 1.6 JVM it appears that this Full GC behavior is no longer there, which is a better thing.  However and as I mentioned above, we have several clients using ModelGlue/Mach-ii-ColdSpring-Reactor/Transfer and in that case we have observed memory problems which often resulted in the heap running out of memory.  Whatever default Full GC behavior in is the 1.6 JVM it appears inadequate for some CF applications.  Through endurance load testing (up to 12 hours) we have found that causing explicit Full GC's every 10 minutes is an optimal setting.  To enable this you need to add these two arguments to the JVM arguments in the jvm.config file located either in {drive-letter}\ColdFusion8\runitime\bin or {drive-letter}\JRun4\bin, depending on your install:

-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000

This will run explicit  Full GC's every 10 minutes.  Considering what we have found we strongly advise that you do not disable explicit Full GC's and if you have done so we suggest you replace that with the arguments shown here.  All instances will need to be restarted after adding these arguments.

Comments

Brian

Brian wrote on 08/05/08 5:10 AM

Mike -- little off topic ... have you seen any evidence that similar setups and java settings that Linux v Windows performs any better or worse?
Michael Sharman

Michael Sharman wrote on 08/05/08 5:39 AM

Hi Mike, thanks for posting your findings.

>This will supposedly be fixed when the latest beta of the 1.6 JVM is released.

Is this correct? Isn't CF8 already (by default) using JVM 1.6?
Mike Brunt

Mike Brunt wrote on 08/05/08 10:52 AM

@Brian it depends if we are talking 32 bit then Unix-Linux has an advantage over Windows in that you can use up to 3GB for the heap, in Windows that is effectively 1.5GB. On 64 bit systems I feel the difference in terms of heap memory goes away because so much is available irrespective of OS.
Mike Brunt

Mike Brunt wrote on 08/05/08 10:55 AM

@Micheal, thanks for your kind comments. Yes CF is using Sun JVM 1.6 but there is an update to the 1.6 JVM in beta and also a 1.7 in the works both of which supposedly fix the class loader issue. You can find more information here...

http://java.sun.com/javase/downloads/index.jsp
Wil Genovese

Wil Genovese wrote on 08/05/08 1:52 PM

"-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000"

We've been doing this for years now with JVM 1.4 and now with JVM 1.6
Mike Brunt

Mike Brunt wrote on 08/05/08 5:26 PM

Yes Wil it is definitely good practice and seems even moreso for ModelGlue/Mach-ii-ColdSpring-Reactor/Transfer apps.
games

games wrote on 03/13/10 3:26 AM

why my comment dont submitted??

Write your comment



(it will not be displayed)



Leave this field empty: