My two-node ColdFusion cluster over the past month has been running out of memory after 3-4 days and starting to hang as the JVM thrashes to free up memory. It was clearly a memory leak as the free RAM would drop into the sub-100MB range and then bounce about wildly. Nearly idle, a single running thread would only complete within 60 seconds 50% of the time, even for simple tasks.
I know that unscoped variables can be source of memory leakage in CFC-based applications so I downloaded the latest copy of Mike Schierberl’s varScoper to check for any missing “var”s. Turns out some changes I had made in code about a month ago (gee, what a coincidence) introduced some unscoped variables in the session scope. The next few days will tell if that was the cause of the issue but the lesson is clear: run varScoper periodically to catch your mistakes.
When I converted my API over a year ago from my own CFCs to Model-Glue/Transfer/Coldspring, I ran varScoper regularly and it caught a lot of legacy mistakes. I haven’t run it in quite some time. I need to look at Henke’s varScoper ANT task which would automate the checks into my build process ensuring that I never roll code with this problem. Now to find an extra 15 minutes…
Comments are closed.