[Prev] Thread [Next]  |  [Prev] Date [Next]

[cfaussie] Re: CF 9.01 memory leak - coldfusion.util.key Dave Tue Feb 21 23:00:52 2012

There are no error messages in production because we catch the problem
before it gets that far. Using HP JMeter (and GC Logging) over a
period of days, we can see Time in Full GC trend upwards, along with a
reduction of free heap after full GC and reduction in GC interval.  On
the 16 gig heap we start @ 6 seconds per full GC with a 15 minute
interval (for the first 1-2 days), down to 20 seconds per full GC
every minute after around 2 weeks.  Analysing Heap Dumps with MAT
shows gigs of heap taken up by ColdFusion.util.key
In my original test, I was talking about the fact that those classes
remain on the heap even after the code has stopped and a full GC as
taken place. (as viewable in a heap dump) But you are right, that’s
not necessarily evidence of a memory leak.
I’m as sceptical as you are about someone finding a real, obvious
memory leak in a CF production release and I want to be proven wrong.
However, this testing shows a memory leak on every CF9 box I try.
 Tracking memory usage is turned off.  We use FusionReactor/jVisualVM/
HPJMeter for analysis.
Try the following two slight variations in the same code.  I use
Apache JMeter with two threads in my testing.
<cfset transient = structNew() />
<cfset base = getTickCount() />
<cfloop from="1" to="10000" index="index">
   <cfset transient[hash("#base##index#")] = true >
<cfset transient = structNew() />
<cfloop from="1" to="10000" index="index">
   <cfset transient[hash("#index#")] = true >

Test1.cfm will die (Error: GC Overhead limit exceeded) after only 1-2
minutes, whereas test 2 will run happily and never even see the
thinks it is a problem with CF Caching the upper case version of the
struct key, and given the above test, I think he is right. The same
problem exists using myStruct.key notation.

On Feb 22, 4:02 pm, "charlie arehart" <[EMAIL PROTECTED]>
> Dave, I've run that code on a 9.01 server, and run it over and over, and I
> am not finding there to be any "leak". I know that's a frequent assertion
> made against CF. Let's see if we are on the same page about what I'm seeing
> versus what you are seeing.
> First of all, my CF instance never crashes, despite repeatedly running the
> request. If there was a leak, you'd not expect that, right? And my max heap
> size is only 400m for this test, so you'd think I'd hit that limit pretty
> fast, I suppose, right? More than that, I am watching the memory in the CF
> Server Monitor and FusionReactor, and while it does go up, it doesn't "keep
> going up" with each run. Again, that's what you'd expect if there was a
> leak, right?
> Finally, and most important, I never get any outofmemory errors in the CF
> console log. How about you? To be honest, unless I'm getting an outofmemory
> error that refers to either the heap or the GC overhead limit, I wouldn't
> myself worry about doing heap dumps, MAT analysis, nor would I have concern
> over a "memory leak".
> But perhaps you DO get an OOM error eventually, or see the memory constantly
> climbing and then CF does crash. In that case, I wonder if the explanation
> is something else (since I don't get that error, while also running on CF9).
> Do you have the CF Server Monitor "start memory tracking" feature enabled?
> It doesn't matter if you "don't have the monitor open". That's has no
> bearing. If you or anyone on that server ever turned it on, it stays on,
> even if the monitor interface is not displayed, and it also stays on over
> restarts. So since you're on CF 9.01, look in the CF Admin at the Monitor
> Settings page. Is the checkbox checked for "enable memory tracking"? If so,
> turn it off.
> Then restart CF, and try your test again. I only suggest restarting so that
> any objects still in memory are released, so you can try your test again. If
> this was the solution, then it may be simply that your CF8 server did not
> have it enabled.
> All this is a guess, but let us know what you find.
> /charlie arehart
> Providing fast, remote, on-demand troubleshooting services for CF (and
> CFBuilder)
> More athttp://www.carehart.org/consulting
> > -----Original Message-----
> > Behalf Of Dave
> > Sent: Tuesday, February 21, 2012 10:38 PM
> > To: cfaussie
> > Subject: [cfaussie] CF 9.01 memory leak - coldfusion.util.key
> > Hey all,
> > I believe I had discovered/confirmed a memory leak in CF 9.01.
> > We have a large application that ran for months at a time on CF 8.01,
> > on CF9, we leak a few hundred MB each day. The application makes lots
> > of use of structs/classes. Using MAT, we can see that a
> > coldfusion.util.key is created of each and every struct member, but
> > never cleaned up.
> > Try the following test on a fresh re-started JVM:
> > <cfset transient = structNew() />
> > <cfloop from="1" to="1000000" index="index">
> >    <cfset transient[index] = true>
> > </cfloop>
> > Use VisualVM to force a GC, do a heap dump, then open the heap up and
> > search for coldfusion.util.key - you will see 1,000,000 + of them.
> > They will never be collected.
> > The same code does not have this problem on CF8.
> > Original CF bug:http://www.elliottsprehn.com/cfbugs/bugs/86893 (now
> > removed???)
> > New CF bug:https://bugbase.adobe.com/index.cfm?event=bug&id=3119991
> > Is anyone else seeing this problem or needing to re-start their CF9.01
> > servers regularly to keep them running?
> > --
> > You received this message because you are subscribed to the Google
> > Groups "cfaussie" group.
> > To post to this group, send email to [EMAIL PROTECTED]
> > To unsubscribe from this group, send email to
> > For more options, visit this group at
> >http://groups.google.com/group/cfaussie?hl=en.

You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at