I think Dave is right - trying to optimize by garbage collecting on your recordsets might be stretching it - perhaps you should look elsewhere in your code. Additionally, I agree that using ColdFusion to make a mass mailer isn't the best use of ColdFusion. There's plenty of other applications that do a much better job of this.
However, for the academic sake of it, the best approach might be to encapsulate logic in COM or CFX tags. You'll have better memory control, so there's no concerns once control gets returned to the CF engine (what you do in your COM object or CFX tag controls your memory situation). ----- Original Message ----- From: "Dave Watts" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, November 01, 2001 2:36 PM Subject: RE: Deleting a Query??? > > Does anyone know if there is a way to delete query results, > > before the page is done processing??? I have a couple of pages > > that compile info and send mass emails, but some of the queries > > are only needed for a short period, but (correct me if I am > > wrong) the results of those queries will stay in memory until > > the page is done. Well, when one of the results can easily have > > over 50,000 rows, that is a lot of memory that could be freed > > up and either speed up the other processes running, or allow > > more to be run simultaniously. Any answer or push in the right > > direction would be VERY much appreciated. > > I'd guess that the resultset is retained in memory for the duration of the > page processing, but I don't know for sure - it's not unimaginable that the > parsing process notes when something is no longer needed as a basis for > garbage collection at runtime. > > You might be able to flush the recordset from memory by simply overwriting > the variable: > > <cfquery name="qSomething" ...> > .. > <cfset qSomething = ""> > > However, ideally your page won't take so long to run that this makes any > significant difference. If your page is doing something that takes that > long, you should look at doing that within something else, and perhaps > triggering the start from CF. For example, if you're sending these mass > emails, and it takes a very long time to run, maybe you should handle the > mass emails from something else, and let your CF engine stick with what it > does best - generate HTML output dynamically. > > Finally, I don't think you'll get more processes running as a result of > freeing the memory. With CF, you get a set number of threads that exist over > the life of the service. This is specified within the CF Administrator. > Those existing threads might execute more efficiently given the additional > free memory, though. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

