Re: possible bug in XMLHttpRequest
"Erik Arvidsson" <[email protected]> Sat, 26 Oct 2002 02:24:18 +0200
| Newsgroups | gmane.comp.mozilla.devel.xpfe,gmane.comp.mozilla.devel.xpcom |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
I hope someone else can answer you. I don't know when the GC is supposed to be run and I don't know the correct XPCom interfaces to work with this. Hopefully some official Mozilla JS developer (like Robert Ginda, Brendan Eich or Waldemar Horwat) can help you. Maybe the GC is supposed to be run after every JS thread and then this is definitely a bug? erik "jose antonio" <[email protected]> wrote in message news:[email protected]... > Erik Arvidsson wrote: > > > The memory will only be freed once the garbage collector kicks in. > > > > erik > > > > "jose antonio" wrote in message > > news:[email protected]... > > > > >Hello, > > >I am trying to get remote XML with XMLHttpRequest. my source code is: > > > > > >function load() { > > > var req = new XMLHttpRequest(); > > > req.open("GET","http://www.foo.com/anxml.xml",false); > > > req.setRequestHeader('content-type','text/xml'); > > > req.onload = function() { > > > alert("received"); > > > } > > > req.send(null); > > > > > >} > > > > > >it works, but When I execute the function load more than once, the > > >memory used by mozilla grows exactly the size of the document I am > > >requesting. For example: > > > > > >first time: 22.4 mb; > > >second time: 23.4 mb; > > >third time: 24.4 mb; > > > > > >when the file size is 1mb; > > > > > >But, if I initialize the req object like a global variable, the memory > > >is always the same. > > > > > >I don't understand why the memory is being increased. The object would > > >be destroyed every time the function load finishes. Or it would not? > > > > > >Is it a bug? Is it correct? > > > > > >Thanks. > > > > > > > > > > ok, How can I decide to kick in the memory? Is there any Component to > access it? > > I think it could be interesting. I need to free the memory after each > request. > > In addition, my function have the request object like a local var. When > the function has finished the memory might be freed. >