Skip to main content
This topic has been closed for replies.

3 replies

Participant
June 2, 2011

This a ColdFusion bug. See this StackOverflow answer: http://stackoverflow.com/questions/5898291/coldfusion-util-key-memory-leak-issue-with-structure-keys/5906246#5906246. Here's the link to the bug in ColdFusion tracker: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=86893http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=86893

P.S. Dear Adobe, please fix the flash monstronsity that is the ColdFusion bug tracker. Use HTML so Google can index it and I don't feel like chewing off my arm every time I come into contact with the horrible thing. k thx bye.

Participant
June 2, 2011

I have notice a similar problem when using a JavaLoader library to use some jar libraries to connect to an ERP system. This might explain the problem better for you. Hope this help.


http://www.compoundtheory.com/?ID=212&action=displayPost

Inspiring
May 24, 2011

I finally remember to investigate this.  I ran your code in the office - CF8.0.1 - and did not see what you were seeing.  The new gen loaded up as expected, but it was GCed as expected too, once the new gen filled up.  No problem.

However I just ran the code on CF9.0.1, and saw exactly what was reported on StackOverflow.  Eventually the JVM ground to a halt, too... after a dozen or so runs.

However, I thought the example code was unnecessarily convoluted, and wasn't really clear where the problem lay.  I refactored it to get rid of the java UUID, and just used the index variable as the struct key.  And there was no problem.  Then I changed it to use createUuid() instead, and whilst being quite slow (although much faster on CF9.0.1 than on CF8.0.1), there was still no problem.

So what that code demonstrates is that there might be a memory leak when using Java UUIDs.

So... err... don't build structs with 100000 keys using Java UUIDs as said keys.  That's my advice.

--

Adam

February 22, 2012

Adam,

We have found the same memory leak on CF 9.01 with an application that was running for months on end on CF8.01  On CF9.01, the app leaks around 2.5 gig every 2 weeks.

Looking at the heap dump on MAT at the moment and we have millions of instances of coldfusion.util.key floating around on the heap, never GCed.  We don't use Java UUID's as struct keys, however we have a large code base and do quite often access structs as myStruct['foo'].

Maybe the reason you were not seeing the issue when using the index as the struct key was because the key is 1/4 size of the UUID? 

Dave