[webkit-help] Possible memory leak or cache problem

Patrick Mueller pmuellr at muellerware.org
Mon Oct 5 08:31:14 PDT 2009

john.kjellberg at power.alstom.com wrote:
> Thanks for trying this. I tested it and it didn't help at all on my 
> computer. Also, it would have been strange since I'm actually using the 
> same XMLHttpRequest() for each call. Not sure how JS handle it though, 
> since the script still works after doing "delete.".
> I also tried to create a new XMLHttpRequest() and deleting it for each 
> request. That didn't change anything.

Now that I look at it, that does seem odd, that the delete worked at all 
for me.  hmmm ...

I've always kinda wondered about reusing XMLHttpRequest objects; whether 
it's really kosher to do so or not.  It doesn't seem like it should be, 
but of course, you can, given the API, so people will do it.

Maybe try creating a new one each time, deleting it after finishing 
processing it.  The logic on how to clean up the multi-used XHR objects 
may be a bit messy - just doing a single request with each, and then 
cleanup afterwards, may give you better results.

Patrick Mueller - http://muellerware.org

More information about the webkit-help mailing list