Hi, I'm working on a very old and very badly coded CF application at the moment. It contains servertasks that do a lot of batch processing where huge data sets are queried from a database, processed and the results written back to the DB. Unfortunately by now the jobs have become so large that we frequently get heap space errors. I'm trying to figure out why the process takes up so much memory and I've reached a point where I just don't know what to look for anymore. When looking at the memory monitor it looks to me like in every loop iteration he accumulated about 100 MB of data, procceses it and throws it away, but not entirely. A small piece stays in the memory every time and in the end it clutters up all the heap space.
What I already did: - Adding "var" to local variables - Replacing literals in queries with cfqueryparams - Replacing StructNew() at the beginning of loops with StructClear() - Replacing query-loops with index-loops I also started looking at dumps of the Java heap shortly before the process crashes, but I'm not really getting any wiser from that. I see that there are millions of objects in the memory and many of them are LoopTags and QueryTags, but other than that I have no idea what to make of it. I've read that placing the code of the loop within its own thread might help, but that's impossible because our task already runs in its own thread and apparently CF can't spawn threads from within threads. If you have any ideas for me where to look for memory leaks, what else to try or an explanation for what might cause the problem, I would be really really thankful! Greetings, Till Helge ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354115 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

