Eric, you are absolutely right that the ColdFusion garbage collection does not delete the request information from memory until the end of the request, but I have described it in sufficient detail in another SO question . In short, you end up in OoM Exceptions when you loop requests. You can prove this with a tool like VisualVM to generate a bunch of heaps at runtime, and then run the resulting dump via the Eclipse Memory Analysis Tool (MAT). What MAT will show you is a big hierarchy, starting with an object with the name (I don't do this) CFDummyContent , which contains, among other things, links to cfquery and cfqueryparam . Please note that trying to change it to stored processes or even interacting with the database through JDBC does not matter.
So. What kind. For. Whether there is a?
It took me a while to figure out, but you have 3 options in increasing order of difficulty:
Using cfthread is as follows:
<cfloop ...> <cfset threadName = "thread" & createUuid()> <cfthread name="#threadName#" input="#value#"> <cfset thread.passOutOfThread = somethingGeneratedInTheThread> </cfthread> <cfthread action="join" name="#threadName#"> <cfset passedOutOfThread = cfthread["#threadName#"].passOutOfThread> </cfloop>
Please note that this code does not use asynchronous processing, therefore immediate merging after each call to the thread, but rather a side effect that cfthread works in its own request area, regardless of page,
I will not close ColdFusion gateways here. HTTP chain-chain means performing an increment of work, and at the end of the increment, it starts a request for the same algorithm that tells it to execute the next increment.
Basically, all three approaches allow you to collect these memory links in the middle of the process.
And yes, for those who ask, errors have been raised with Adobe, see the question referred to. In addition, I believe this issue is specific to Adobe ColdFusion, but have not tested Railo or OpenDB.
Finally, need piercing. I spent a lot of time tracking this, fixing it in my own large code base, and some others listed in the question mentioned also have. AFAIK Adobe does not acknowledge that the problem was resolved in order to fix it. And, yes, this is a mistake, simple and simple.