Search code examples
coldfusioncoldfusion-8

ColdFusion server crashing on hourly basis


I am facing serious ColdFusion Server crashing issue. I have many live sites on that server so that is serious and urgent.

Following are the system specs:

Windows Server 2003 R2, Enterprise X64 Edition, Service Pack 2 ColdFusion (8,0,1,195765) Enterprise Edition

Following are the hardware specs:

Intel(R) Xeon(R) CPU E7320 @2.13 GHZ, 2.13 GHZ 31.9 GB of RAM

It is crashing on the hourly bases. Can somebody help me to find out the exact issue? I tried to find it through ColdFusion log files but i do not find anything over there. Every times when it crashes, i have to reset the ColdFusion services to get it back.

Edit1

When i saw the runtime log files "ColdFusion-out165.log" so i found following errors

error ROOT CAUSE: 
java.lang.OutOfMemoryError: Java heap space

javax.servlet.ServletException: ROOT CAUSE: 
java.lang.OutOfMemoryError: Java heap space

04/18 16:19:44 error ROOT CAUSE: 
java.lang.OutOfMemoryError: GC overhead limit exceeded

javax.servlet.ServletException: ROOT CAUSE: 
java.lang.OutOfMemoryError: GC overhead limit exceeded

Here are my current JVM settings:

enter image description here

As you can see my JVM setting are

Minimum JVM Heap Size (MB): 512

Maximum JVM Heap Size (MB): 1024

JVM Arguments

-server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=512m -XX:+UseParallelGC -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib

Note:- when i tried to increase Maximum JVM Heap size to 1536 and try to reset coldfusion services, it does not allow me to start them and give the following error.

"Windows could not start the ColdFusion MX Application Server on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 2."

Should i not able to set my maximum heap size to 1.8 GB, because i am using 64 bit operating system. Isn't it?


Solution

  • How much memory you can give to your JVM is predicated on the bitness off your JVM, not your OS. Are you running a 64-bit CF install? It was an uncommon thing to do back in the CF8 days, so worth asking.

    Basically the error is stating you're using too much RAM for how much you have available (which you know). I'd be having a look at how much stuff you're putting into session and application scope, and culling back stuff that's not necessary.

    Objects in session scope are particularly bad: they have a far bigger footprint than one might think, and cause more trouble than they're worth.

    I'd also look at how many inactive but not timed-out sessions you have, with a view to being far more agressive with your session time-outs.

    Have a look at your queries, and get rid of any SELECT * you have, and cut them back to just the columns you need. Push dataprocessing back into the DB rather than doing it in CF.

    Farm scheduled tasks off onto a different CF instance.

    Are you doing anything with large files? Either reading and processing them, or serving them via <cfcontent>? That can chew memory very quickly.

    Are all your function-local variables in CFCs properly VARed? Especially ones in CFCs which end up in shared scopes.

    Do you accidentally have debugging switched on?

    Are you making heavy use of custom tags or files called in with <cfmodule>? I have heard apocryphyal stories of custom tags causing memory leaks.

    Get hold of Mike Brunt or Charlie Arehart to have a look at your server config / app (they will obviously charge consultancy fees).

    I will update this as I think of more things to look out for.