8 Replies Latest reply: Feb 28, 2012 9:53 PM by rupesh_kumar RSS

    Memory leak found - coldfusion.util.key

    Davo112233

      Hey All,

       

      I found this memory leak in CF9.01 and have confirmed it still exists in CF10. 

       

      To reproduce, create two .cfm files & hit them in an Apache JMeter test with two threads.  I'm using a brand new install of CF10 with inbuilt web server.  MemoryLeak.cfm will not acheive 100 requests (GC overhead limit exceeded), where as my NoMemoryLeak.cfm test is up to 500,000 tests and still going without the old gen increasing at all.

       

      Obviously this is not real production code, but on a very large OO app that also uses lots of structs the test server needs rebooting every 2 weeks due to same problem.  We are on CF8 at the moment and want to spend AU$50,000 on a 9.01 upgrade with maintenance for a 10.0 upgrade but can't move because of this memory leak. 

       


      -- MemoryLeak.cfm

       

      <cfset transient = structNew() />

      <cfset base = getTickCount() />

      <cfloop from="1" to="10000" index="index">

      <cfset transient[hash("#base##index#")] = true >

      </cfloop>

      <cfoutput>

      Done

      </cfoutput>

       

       

       

      -- NoMemoryLeak.cfm

      <cfset transient = structNew() />

      <cfloop from="1" to="10000" index="index">

      <cfset transient[hash("#index#")] = true >

      </cfloop>

      <cfoutput>

      Done

      </cfoutput>