Using ajaxCFC or DWR engine.js
When you manage a lot of content without reloading the page, be aware to null any part of your code, where you use the NEW statment.
x= new WDDXRecordset(); // x= null; // this prevents the page from assigning memory for data, that you don't use anymore. Otherwise it can kill you browser, as it is not garbage collected in IE, until you leave the page.
If you use the DWR engine.js be sure to add this code to the file. Search for function: DWREngine._clearUp and modify the cleanup part of the request object. ------------------------- if it is the XHTMLRequest Object ... // IE 7 req = new XHTMLRequest(); req.abort(); req.onreadystatechange=null; // this leaks, as it is a circular reference if not set to null; req =null; ------------------------- if it is an ActiveX // IE 6 req = new ActiveX Object.... req.abort(); req =null; -----------------------
if you use ajaxCFC be sure to add the following line at the function "returnAjax" in file ajax.cfc
#result# DWREngine._handleResponse('#id#', _#id#); _#id#=null;
The last line sets new WDDXRecordset() to null after processing. Otherwise your memory grows up and up by each ajax request, when not reloading the page !