tracker issue : CF-3286878

select a category, or use search below
(searches all categories and all time range)
Title:

CFC Creation Memory Leak

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): KlaasJan Winkel / KlaasJan Winkel (elklaaso)

Created: 07/12/2012

Components: Performance

Versions: 9.0.1

Failure Type: Memory Leak

Found In Build/Fixed In Build: 9.0.1 /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Windows 7

Vote Count: 2

Duplicate ID:	CF-3119991

Problem Description:

Created cfc's within one request will NOT be garbage collected even if the coldfusion variable holding it is set to empty string or set to a new cfc/value.
This is unacceptable for batch processing large amount of data using cfc's. This worked fine with coldfusion 8 (speed doesnt matter much for me, just that the code is maintainable, hence cfc's).

Steps to Reproduce:

This piece of code:
 
                <cfscript>
                for (j = 1 ; j LTE 500000 ; j = (j + 1))
                {
                        dummyc = createObject("component","Dummy");
                        dummyc.dummyf();
                }
                </cfscript>
 
that creates objects like this one:
 
<cfcomponent name="Dummy" output="false">
        <cffunction name="dummyf" access="public" output="false" hint="" returnType="void">
        </cffunction>
</cfcomponent>

Actual Result:

Will use about 2GB of memory

Expected Result:

While in coldfusion 8 and reportedly also in coldfusion 10, uses only about 600mb

Any Workarounds:

Tried a lot, but found nothing.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3286878

External Customer Info:
External Company:  
External Customer Name: elklaaso
External Customer Email:  
External Test Config: My Hardware and Environment details:



Coldfusion update 2, development mode (jrun web server), sandy bridge cpu, 10GB allocated to coldfusion server.

Attachments:

  1. July 13, 2012 00:00:00: 1_cf9_memorygraph_500000iterations.JPG
  2. July 13, 2012 00:00:00: 2_cf8_memorygraph_500000iterations.JPG
  3. July 13, 2012 00:00:00: 3_cf9_heapdump.JPG

Comments:

A function needs to be executed on the cfc for it to start using memory, seems like its lazy-initialized. Is using upto about 2 gigabytes of memory on CF9. And almost nothing on CF8. I analyzed a heap dump in eclipse memory analysis tool (MAT). All the cfc's created in cf9 stay referenced under a java object and this is why they are not garbage collected. The cfc's in memory comprise of CFdummycomponent, variablescope and some other java objects. Because the references to them are kept, even though they are not referenced in coldfusion anymore, java cannot garbage collect them. This basically means that batch processing can not be done with coldfusion anymore (using cfc's), unless a lot of memory is allocated. On cf8 this was not a problem, because stuff not referenced in coldfusion was not references in underlying java either anymore. (cf8 did keep queries, cfsavecontent and some other stuff in memory, but i did not use this). Can anybody confirm this or give me a solution? I tried so much things, nothing helps, i tried almost all cf9 admin settings. Im am creating a lot of cfc's in a batch process, this was no problem on cf8, but now we need 5,5g of memory for this batch process while in the past just needed 1g. Thanks in advance, Klaas-Jan Winkel
Comment by External U.
18719 | July 12, 2012 02:24:11 PM GMT
Performing a garbage collection does not help, as they are still referenced in the thread.
Comment by External U.
18720 | July 12, 2012 02:26:09 PM GMT
The workaround i posted here actually works very well and increases performance: http://forums.adobe.com/message/4554430#4554430
Comment by External U.
18721 | July 12, 2012 03:16:16 PM GMT
For addtional information, please refer to the forum thread http://forums.adobe.com/message/4555585#4555585 and to the notes in the bug report https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3124148
Vote by External U.
18722 | July 14, 2012 06:56:32 AM GMT
This bug definitely impacts productivity. The memory leak leads to a huge memory allocation for jrun (more than 3.5 GB) in a few hours and web visitors experience poor website performance.
Vote by External U.
18723 | April 25, 2013 09:33:42 AM GMT