i've written a gadget for Windows Sidebar. This essentially means that it is a miniature web-page, that runs for months on end.
After a few weeks the memory usage (working set) of the sidebar.exe process that houses 3rd party gadgets runs into the hundreds of megabytes.
Without a way to identify the source of memory leaks, i simply assume it is the rumored XMLHttpRequest closure problem. Although in my case i'm not doing it asynchronously. So i guess it's just JAX rather than AJAX.
The javascript function involving the web hit:
function FetchXML(method, url)
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{ // Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
throw "XMLHttp not supported"
}
}
}
xmlHttp.open(method, url, false);
xmlHttp.send(null);
if (xmlHttp.status != 200)
{
throw "Server returned status code "+xmlHttp.status.toString();
}
if (xmlHttp.responseXML.parseError.errorCode != 0)
{
throw "Error in returned XML: "+xmlHttp.responseXML.parseError.reason;
}
var responseXML = xmlHttp.responseXML;
xmlHttp = null;
return responseXML;
}
Does this look like it could ever be the source of a memory leak?
i fear that without an actual closure i'm back to square one.