Posted in ColdFusion | Posted on 05-14-2009 | 2,558 views
For a while now I've seen an odd issue with image resizing on the Mac (and then Windows as well). Sometimes when I would resize an image, it would take an extremely long time to finish. I'm not talking about expected slowness for a large image/high quality resize. I'm talking about some images take a few seconds, and others taking well over 2 minutes while my CPU went thermonuclear.
This was very hard to reproduce, although I had one image by Steven Erat that seemed to be pretty consistently 'bad' in terms of tripping up this issue.
Other people have not always been able to reproduce this. I know Jared has seen it, but I'm not sure many other people. RIAForge seemed to suffer from it for all images when doing screenshots.
So anyway, it was a very odd issue and that was hard to test. I spoke to Adobe engineering this morning and they pointed out that it was a confirmed bug in the 1.5 JDK. I switched my ColdFusion to use 1.6 and at first it didn't help. I did a quick check and saw that I was at: build 1.6.0_07-b06-153
I went to Apple's Java downloads, grabbed the latest update, and went up to 1.6.0_13. After restarting ColdFusion, the previous resize which had taken around 48 seconds went down to 800ms.
Hope this helps others.


http://www.dansshorts.com/post/coldfusion-image-pr...
Dan
No need to worry. The new JVM will install in a new directory so you will be able to switch back to the old one quickly if you get re-start problems. This is how I did the upgrade on Server 2003.
1. Install the latest JVM and note down the path. On my system the path is (I'm running v12):
C:/Program Files/Java/jdk1.6.0_12
2. Edit the jvm.config file (on my multiserver installed version of CF8, this is in C:\JRun4\bin
3. Find the 'java.home' line and comment out. Then add a new line for the latest JVM - mine looks like this:
#java.home=C:/JRun4/jre
java.home=C:/Program Files/Java/jdk1.6.0_12
4. Restart the JRun or Coldfusion service.
If there are any problems you'll get an error and can then simply uncomment the original java.home line and remove the new one.
The only problem I had was installing the JDK instead of the JVM.. :)
Give it a go.
The new java home path needs to point to the JRE not the JDK so from your example it would be
C:\Program Files\Java\jdk1.6.0_12\jre
not
C:\Program Files\Java\jdk1.6.0_12
other than that it should work fine.
jedi make mistakes?!! :)
That path is exactly what I am using on my install and it's working fine - I took it from my jvm.config.
Wonder if my install is slightly different. Strange.
http://developer.apple.com/java/
The newest update on that page is for 1.6.0_07.
Are you sure it's 1.6.0_13? I don't think that exists for OS X.
Can you give us the java -version output?
I logged into my ADC account, and it's not even there.
That's because they forgot to update the java listing page.
If you click the link in my previous post and look at the middle of the page there's info about "Java for Mac OS X 10.5 Update 2".
Here's the KB article:
http://support.apple.com/kb/HT2733
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-196)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-77, mixed mode)
The only way to download this is to login to http://connect.apple.com/ and then look at the Java downloads. The accounts are free in case anyone wondered.
It's a Developer Preview of Java for OS X and not officially supported or distributed yet.
FYI to folks - I wouldn't normally do an unofficial JRE but as this is a developer machine, I didn't care.
05/15 11:22:12 error Could not pre-load servlet: ColdFusionStartUpServlet
[1]java.lang.UnsupportedClassVersionError: Bad version number in .class file
Followed by lots of NPEs as a result of that I think.
Are you sure CF is starting with Java 1.6 Ray? After installing that update if you don't change the symlink for /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK to point to 1.6 CF will start with 1.5 instead.
Ooooh look at you.. Mr Fancy 'pre-release' Pants.. ;)
If all you do is change CurrentJDK CF will start with 1.5, but load lots of 1.6 code from the framework which is very odd, and also broken.
Once I changed 1.6 to be the preferred JVM in the Java Preferences.app it all worked fine. How odd.
Anyway, thanks for the tip about the java update, and sorry for the comment thread hijack!
C:/Program Files/Java/jdk1.6.0_12
Coldfusion administrator reports this path is being used:
C:\Program Files\Java\jdk1.6.0_12\jre
So at least on Server 2003 specifying the path *without* the JRE works fine.
I am intending to video blog the upgrade process soon to help anyone who is a little uncertain on how to perform it on Server 2003.
Will add comment when done.
on the flip side. after you've updated your jvm you can use javara to remove the previous version and free up some space.
http://raproducts.org/javara.html
[Add Comment] [Subscribe to Comments]