Some people have been noticing dramatically slower application startup times on ColdFusion 8 compared to ColdFusion MX 7. I've seen a lot of complaints about shared hosting systems where applications timeout. Since CF8 is so much faster than CFMX7, you might wonder why application startup times can be so much worse.The answer is Java 6. For all the other performance improvements and increased functionality in Java 6, it introduced a bug in the class loader that causes substantially slower class loading. You can see a discussion of the problem on Sun's forums. I rolled my Mac back from Java 6 Developer Preview to Java 5 and noticed a huge difference: an application that took six and a half minutes on Java 6 to start from cold, on a server with no class files in cfclasses, took around 50 seconds on Java 5. You're only going to see this on applications that cause a large number of classes to be loaded at startup, i.e., framework-based applications that rely heavily on CFCs. You actually suffer the slow class loading on all applications but it's particularly noticeable on framework-based apps, especially ones that use Transfer (due to the high number of class files generated). My recommendation
Java 6 and ColdFusion 8
January 14, 2009 · 49 Comments
Update: The Java 6 class loader bug mentioned in this post was fixed in Update 10. I just upgraded a 64-bit Red Hat Linux server to Java 6 Update 11 and changed the jvm.config file to specify the new JDK's jre directory for java.home. After restarting the server, it was able to serve up the first page of a complex Model-Glue / ColdSpring / Transfer application in just a few seconds. With the default JDK installed by ColdFusion 8 (1.6.0_04), it took between 30 and 60 seconds to serve that first page. I have updated this blog post accordingly. Thanx to Charlie Arehart for prodding me earlier today on this issue.
Some people have been noticing dramatically slower application startup times on ColdFusion 8 compared to ColdFusion MX 7. I've seen a lot of complaints about shared hosting systems where applications timeout. Since CF8 is so much faster than CFMX7, you might wonder why application startup times can be so much worse.The answer is Java 6. For all the other performance improvements and increased functionality in Java 6, it introduced a bug in the class loader that causes substantially slower class loading. You can see a discussion of the problem on Sun's forums. I rolled my Mac back from Java 6 Developer Preview to Java 5 and noticed a huge difference: an application that took six and a half minutes on Java 6 to start from cold, on a server with no class files in cfclasses, took around 50 seconds on Java 5. You're only going to see this on applications that cause a large number of classes to be loaded at startup, i.e., framework-based applications that rely heavily on CFCs. You actually suffer the slow class loading on all applications but it's particularly noticeable on framework-based apps, especially ones that use Transfer (due to the high number of class files generated). My recommendationfor the time being is to ensure you are using Java 5 to is to upgrade your Windows or *nix JDK to Java 6 Update 11 and use that to power ColdFusion 8. On Windows and Linux, you'll need to download and install the Java 6 Update 11 JDK from http://java.sun.com and then change your environment variables so that CF8 picks the right JDK (start CF8 from the console and you can easily see what JDK it is using). Changing java.home in jvm.config is probably the easiest way to tell CF8 to use the new JDK - it needs to point to the jre directory inside the JDK install. On a Mac it's easier to revert to Java 5 which is the default JDK and CF8 automatically uses it.
Adobe are aware of the issue (in fact, they pointed us at the discussion on Sun's forums).
Some people have been noticing dramatically slower application startup times on ColdFusion 8 compared to ColdFusion MX 7. I've seen a lot of complaints about shared hosting systems where applications timeout. Since CF8 is so much faster than CFMX7, you might wonder why application startup times can be so much worse.The answer is Java 6. For all the other performance improvements and increased functionality in Java 6, it introduced a bug in the class loader that causes substantially slower class loading. You can see a discussion of the problem on Sun's forums. I rolled my Mac back from Java 6 Developer Preview to Java 5 and noticed a huge difference: an application that took six and a half minutes on Java 6 to start from cold, on a server with no class files in cfclasses, took around 50 seconds on Java 5. You're only going to see this on applications that cause a large number of classes to be loaded at startup, i.e., framework-based applications that rely heavily on CFCs. You actually suffer the slow class loading on all applications but it's particularly noticeable on framework-based apps, especially ones that use Transfer (due to the high number of class files generated). My recommendation
Tags: coldfusion · j2ee

49 responses so far ↓
1 Marko // Dec 5, 2007 at 10:31 PM
I haven't noticed a significant difference in the startup time though, but I'll take your word for it :)
2 Peter Bell // Dec 5, 2007 at 11:42 PM
http://www.compoundtheory.com/?action=displayPost&ID=270
3 Marco Di Folco // Dec 6, 2007 at 4:20 AM
I haven't upgrade to CF8 yet ...
Thanks.
4 William // Dec 6, 2007 at 4:46 AM
5 Bernie Dolan // Dec 6, 2007 at 6:01 AM
Which will involve updating the java.home line of ColdFusion's jvm.config file to point to the new Java 5 install. Thanks for tip Sean, for some reason I was under the impression CF8 had shipped with 1.5.
6 Davo // Dec 6, 2007 at 6:58 AM
Cheers,
Davo
7 Terry Schmitt // Dec 6, 2007 at 7:13 AM
8 David Stamm // Dec 6, 2007 at 7:59 AM
You mentioned that startup issues are more noticeable with certain frameworks. Is this happening when application-scoped CFCs are instantiated? Or is this more an issue with CFCs that dynamically load Java classes, such as Mark Mandel's JavaLoader?
9 Sean Corfield // Dec 6, 2007 at 8:18 AM
http://www.compoundtheory.com/?action=displayPost&ID=270
@Terry Schmitt, CF8 on Mac uses the default Java installation which is Java 5 normally so, no, there be no compatibility issues (Pete Freitag's blog post notwithstanding).
@Davo, no, by default, Mac users who did not upgrade to Java 6 will not be affected and if they upgraded, they'll know how to downgrade. I don't use Windows so I can't give instructions for that. For Linux, you ought to know how to install JVMs/JDKs anyway so I'm not helping there either :)
@Bernie, yup, sounds like the right approach. For Java in general you can set the JAVA_HOME environment variable to point to Java 5 - exact details vary across operating systems.
@William, no. I don't use Windows.
@Marco, yes, CF8 lays down Java 6 on Windows and Linux (not on Mac).
@Marko, I was a bit surprised by Pete's post because I had only suggested moving CF8's tools.jar out of the way when he'd pinged me and I'd viewed the upgrade to Java 6 as a separate issue altogether. I think that just moving tools.jar should solve any compatibility issues you hit (because the tools.jar file that ships with CF8 probably assumes Java 6). Moving tools.jar out of the way causes CF to fall back to the installed Java compiler.
10 Sean Corfield // Dec 6, 2007 at 8:59 AM
@Marko, contact me privately to debug your web service problem if you want.
11 Fred Wenger // Dec 6, 2007 at 10:20 AM
Thanks a lot.
12 Laurence // Dec 6, 2007 at 1:37 PM
If you know of a resource that can help, I would appreciate it.
13 Douglas Knudsen // Dec 6, 2007 at 1:39 PM
DK
14 Sean Corfield // Dec 6, 2007 at 2:42 PM
@Laurence, you're right, that's off-topic for this post. However, I will confirm you cannot have multiple EARs in the same server instance that contain ColdFusion. You either need a separate server instance or you need to use WARs. And that's not a JBoss thing really - I'm pretty sure you'll hit that on any J2EE server: it's just the way J2EE servers work.
@Douglas, you can configure each Java application to use a separate JVM / JDK if you want.
15 Dan // Feb 20, 2008 at 5:20 AM
16 Sean Corfield // Feb 20, 2008 at 10:46 AM
17 Drew Morris // Feb 28, 2008 at 9:35 AM
Also... is there an updater planned to address this or are we responsible for finding this JVM on our own and pointing to it? I am assuming it is up to us since its a JVM issue but I thought I would ask...
18 Sean Corfield // Feb 28, 2008 at 11:57 AM
19 Constantine Vu // Apr 19, 2008 at 7:43 AM
I tried CF 8 with both jre 5 and jre 6 and noticed no performance improvement at all in comparison with CF7. Or did anythings missing in my CF8 installation ....?
20 Sean Corfield // Apr 19, 2008 at 8:45 AM
21 Constantine Vu // Apr 19, 2008 at 5:07 PM
22 Sean Corfield // Apr 20, 2008 at 2:39 PM
23 Kris Jones // May 1, 2008 at 5:46 PM
24 robi sen // May 12, 2008 at 11:01 AM
There are a number of Bugs in 1.6 that I have run into that seemed to be resolved in 1.6.0_06. I wonder if you could confirm that it resolves this issue for me since it seems to have for me but I dont have time to test on multiple machines and multiple architectures (I am using 64 bit on VISTA).
Thanks,
R
25 Sean Corfield // May 12, 2008 at 11:59 AM
26 DaveL // Jul 22, 2008 at 3:21 PM
Im new to FB5, im also getting endless compile, ive spent a few days trying to find where im going wrong but ive had no joy. Im not sure if im doing something wrong or its the jre (1.6.0_06) that im using on CF8 (win platform).
Do you know if bug has been fixed in version 1.6.0_06 or do i need to install 1.5?
Thanks Dl.
27 Sean Corfield // Jul 22, 2008 at 4:05 PM
28 Hussein // Oct 29, 2008 at 11:22 AM
http://java.sun.com/javase/downloads/?intcmp=1281
I am quite eager to know what others are experiencing with this recent release from sun, in a production environment.
29 Sean Corfield // Jan 14, 2009 at 6:36 PM
30 James Holmes // Jan 14, 2009 at 8:18 PM
31 Sean Corfield // Jan 14, 2009 at 11:11 PM
32 Jeffry Houser // Jan 15, 2009 at 6:05 AM
How timely to my own development adventures; as I just updated because of the slow load times of Model Glue. This was my exact error:
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54742
Even after the update to Java 6 Updater 11; I'm still having insanely slow times on the first load of a Model Glue app. I set the timeout w/ a cfsetting tag to four minutes and it appears to have addressed the issue.
After the first load things appear to run quite smoothly.
This update does change the HTML generated from the cfmenu tag; however I suspect that will only affect people if they are using cfmenu with a lot of custom styling (I was).
33 Sean Corfield // Jan 15, 2009 at 9:11 AM
34 JP Revel // Mar 11, 2009 at 8:34 AM
I'm wondering if this JVM issue is affecting me. I'm running OS X 10.5.6, with CF8 with JRun as my development system, and am running fusebox 5.5. I have a fusebox app that times out in the fuseboxAction.cfc. The error specifically is a timeout on CFLOOP.
It looks like I'm still running 1.5.0_16-133 of JVM. Am I barking up the wrong tree here?
Thanks putting your mind to this!
JP
35 Sean Corfield // Mar 11, 2009 at 12:09 PM
Also in Terminal, run java -version to confirm the default JVM in use and look in the CF Admin under Server Settings > Settings Summary to confirm CF8 is using the right JVM.
If all of those look good, I'd ask: how many circuits / fuseactions are there in your app and are you using XML (which loads all the circuits at startup)?
36 Steve // Apr 6, 2009 at 1:02 AM
I have tried rebooting... no difference. If i restore the jvm.confik.bak file, I have Coldfusion but with the original java settings.
Any ideas? Thanks.
37 dirk // Sep 3, 2009 at 8:05 AM
Thanx
38 James Holmes // Sep 3, 2009 at 9:32 PM
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55448#300636
39 Jim // Nov 3, 2009 at 11:58 AM
Java Version: 1.6.0_01.
From what I read on this blog I need to get JVM 1.6.0_10. When I go to Sun to download it the current version is 1.6.0_16.
Is it safe to get the current version to run with CF8?
40 Sean Corfield // Nov 3, 2009 at 12:08 PM
41 Jim // Nov 4, 2009 at 6:23 AM
I've tried installing and pointing to the JRE_17 and tried it also installing and pointing to JDK_16.
In both attempts the CF8 service would not start. The coldfusion_out.log error is [no known VMS - check for corrupt jvm.cfg]
I changed the java.home path in the jvm.config and the wsconfig_jvm.config files. Is there something else I need to do?
Thanks, Jim
42 Sean Corfield // Nov 4, 2009 at 8:42 AM
43 Jim // Nov 4, 2009 at 11:16 AM
I got the new jvm in place. When I was manually editing the jvm.config file I replaced the line.
java.home=C:/ColdFusion8/runtime/jre WITH
java.home=C:/Program Files/Java/jdk1.6.0_17/jre
The CF8 Service won't start.
I used the JVM update (Browse) in the CF8 Adminstrator and it created the following line in the jvm.config file:
java.home=C:\\Program Files\\Java\\jdk1.6.0_17\\jre
CF8 service starts. Hopefully this info will save someone a few hours of head scratching.
Thanks for your help.
Jim
44 Mat Evans // Nov 26, 2009 at 3:38 AM
I've just updated a new server we have to 1.6.0_17 try and get round some VERY slow MG startup & running times. It seems to now crash windows2008 after about 5 mins.
Gonna revert back to the normal jre for the time being and see if that helps. Seem to be getting some very strange running times on what is a very simple MG app - on another server we have it's running very quick - sub 100ms even with reload on so there seems to be a problem with our new servers config.
I'll post back anything I come across with regards to jdk 1.6.0_17.
Oh the joys of moving servers
45 Sean Corfield // Nov 26, 2009 at 8:34 AM
46 Sean Tindale // Jan 13, 2010 at 1:10 PM
I am running...
VMWare Guest with 2GB of RAM
Windows Server 2003
jdk1.5.0_15
I do not have access to the source code for this ColdFusion application. I have turned off Report Execution Times and there is no server monitoring.
I am thinking about increasing the VM ram to 4GB and upgrading the JDK to 6 update 18. Id also like to adjust some of the java.args in the jvm.config file. I was wondering what java args other users of ColdFusion 8 where using with Java 6?
(heap space, perm size etc...)
I thought this might be useful to know if people are making changes to the ColdFusion JVM.
Thanks in advance for any feedback.
Sean
47 Dean Bunting // Apr 13, 2010 at 1:00 PM
I've upgraded to 1.6.0_18, and all seems to be running well -- except Verity.
Any CF tags involving Verity or even attempting to access "Verity Collections" through the admin result in a "Could not initialize class com.verity.security.k2.K2Encrypt" error.
Tried Steve Erat's Cryptix fix (http://www.talkingtree.com/blog/index.cfm/2006/12/13/CFMX7-Verity-Java6), but that didn't help. Any idea what Adobe might have changed to the JRE shipping with CF8?
Thanks,
Dean
48 Sean Corfield // Apr 13, 2010 at 1:06 PM
49 Lovetech // Jun 9, 2010 at 12:41 PM
However, the code was running very, very slow on CF8: Simple pages took 45 seconds to load. After 3 days of searching on Internet for a solution, nothing worked. The update to Java 1.6.0_20 reduced the 45 seconds to 40 seconds, still not acceptable.
I finally found the problem: the update did not correctly update the IIS ISAPI filters and kept the "old" CFMX 6.1 link.
Solution:
- Start the IIS Services Manager
- Right click on the Default web site and choose properties.
- Select the ISAPI Filters tab.
Select the JRUN Connector and click on Edit
Type (or browse to) C:\ColdFusion8\runtime\lib\wsconfig\jrunwin32.dll (or wherever your CF8 installation is) and click Apply
- Restart the www service
Hope this helps others to fix this very nasty Adobe bug.
Leave a Comment