Viewing by month: March 2009

ColdFusion, Image Processing, and Memory Spikes

I've been having some serious memory issues with a ColdFusion application that I've narrowed down to CF's image processing functions. Processing no more than 14 megs of images causes a spike of nearly a full gig of RAM while the images are being processed. Here's an example of what's happening when I process images through CF's built in CFImage functionality.

Setup

I have 7 images, which average 2 megabytes a piece. I'm uploading them via a flash widget which processes each in turn in the background. As each image is uploaded, the following things take place:

  1. Image is uploaded to server
  2. The file is saved to a temporary location on disk
  3. Check to make sure it's a valid file with IsImageFile
  4. If it's not, readbinary and rewrite it
  5. Get the image info via cfimage
  6. If the image is wider than 400 pixels, size it down to 400 wide
  7. Insert a record in the database for this image

And that's it... nothing more. This is what the memory usage on my server looks like after uploading 7 images, and then shortly after uploading a single image using the same steps through a standard upload form (to get the flash processing out of the memory usage picture).

Server Monitor.png

When I started the upload process of these 14 megs of images, the memory usage of the server (and I'm the only one using it) was idling at 80 megabytes. The plateaus on that spike (as one image finished processing, and the next started) are at:

  1. 253 mb
  2. 419 mb
  3. 586 mb
  4. 699 mb
  5. 817 mb

The smaller spike directly after was the single image I processed, which jumped from 260 mb to 304 mb.

Also, the server has never fully calmed down after processing the images. I'm really looking for some help to figure out what might be causing these issues. They're resulting in multiple JVM memory alerts daily, and other issues with the application such as dropped sessions and killed threads. If you've seen similar, or have a suggestion to alleviate the problem I'd love to hear it.

7 comments | Posted by Daniel Short on Mar 6, 2009 at 11:49 AM | Categories: ColdFusion -

The Beatles Rock Band

Hurry up September...

The Beatles Rock Band

0 comments | Posted by Daniel Short on Mar 5, 2009 at 10:28 AM | Categories: Rambling -

Missing Instance Manager in CFusion Instance

UPDATE: Downloading a copy of CFIDE from a production server that was working like it was supposed to fixed the problem. Unfortunately the CFIDE directories are full of encrypted cf files so I have no idea what the difference was. Move along, nothing else to see here...

I'm posting this on my blog in hopes that someone can lend me a hand (I don't have enough people following me on twitter ;).

I'm running the following on a local VMWare installation:

Server Product ColdFusion
Version 8,0,1,195765
Edition Developer
Serial Number Developer
Operating System Windows 2003
OS Version 5.2
Adobe Driver Version 3.6 (Build 0027)

For some reason when I get to this server via localhost:8300 I don't have the Enterprise menu available to me. I'm running through the cfusion instance:

CF Server Java Class Path ;C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/ant-launcher.jar

Anyone know what could be wrong?

0 comments | Posted by Daniel Short on Mar 4, 2009 at 1:52 PM | Categories: ColdFusion -