"java.lang.OutOfMemoryError GC overhead limit exceeded" & "java heap space null" - from Coldfusion 8

simonlea
simonlea used Ask the Experts™
on
I am supporting a (quite large) Intranet application written in CF8. About 16 users bashing away at any one moment. It's been quite reliable and the application code has not been modified (substantially) for some months. This week users reported:

"GAMPortal threw an error at Ruth this morning "java.lang.OutOfMemoryError GC overhead limit exceeded". This happened as she tried to add a Worksheet (the update database page threw the error). Yesterday Dave Mill had a "java heap space null" error as he tried to delete an image (the update database page threw the error)."

Perhaps related... we have also seen (very, very ocassionally) a situation whereby a user submits to add a record - and several records are created. This is certainly not "finger trouble" and this area of the application has otherwise worked perfectly for nearly three years!

I found a good post on the error at:

http://java-monitor.com/forum/showthread.php?t=54

I am way out of my comfort zone working at a lower level than CF8 code and CF8 Administrator.

Looking for any GENERAL GUIDANCE about how best to proceed. Thanks in advance.





Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
in general this error means that the cf server ran out of memory
which is caused by some "bad" code.
now bad code isn't always obviously bad - but in certain situations it is.
ex: lets say you are uploading an excel sheet that then gets read and looped through and you build a structure out of the content etc etc ...
in testing it works great and in production it works great
but how do you know it works great?
because you don't get an error?
what if it's hovering just below an error threshold?
how do you know?
then when an excel sheet is a bit larger (or some other criteria) it then errors
then one assumes that something has just now broken

i would say to start researching areas where you are doing recursive loops
the loop logic may be faulty at least under certain situations
and an infinite loop starts running until the server runs out of memory

do you have any code from your update page that you can post?

Author

Commented:
I'd like to leave this question open for a while if poss. I am doing some research to isolate the problem.
There a few monitoring tools you can use to help isolate the problem. If you have memory to spare normally I would use the memory profiling in the internal cold fusion monitor to track your request sizes to help get a lead into the problem. It will also show you your session sizes, application scope memory usage etc. Pretty helpful.

With these errors sometimes it happens spontaneously or you might have an issue with a memory leak which will not show up in the cold fusion monitor. If this is the cause and there are no real trends you can find then I would turn to sun's JDK or oracles jrockit jvm. Oracle's Jrockit JVM is basically the hotspot jvm with hooks into it to allow memory tracking and memory leak detection. Pretty useful tool if you can get it running.

If you don't want to change your JVM to a 3rd party like Oracle then download the hotspot (suns) JDK and switch your jvm.config over to use the JRE in the JDK. This will allow you to use the jvisualvm.exe tool in the bin directory and take multiple heap dumps while the JVM is running. Once you have these heap dumps you can analyze them within jvsiaulvm.exe for basic information or use eclispe's memory analyzer tool for an indepth analysis: http://www.eclipse.org/mat/

That tool also has a memory leak detector report and will also give you the ability to track objects that are consuming the most heap by class. Here is a good article to follow if you end up going down that route: http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6856

Don't get burnt out on these type of errors sometimes they can be very difficult to troubleshoot. Hope this helps get you started.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial