Closed
Bug 280808
Opened 20 years ago
Closed 20 years ago
XMLHttpRequest leaks
Categories
(Core :: XML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: alex, Unassigned)
References
()
Details
(Keywords: memory-leak, regression)
Attachments
(1 file, 1 obsolete file)
595 bytes,
patch
|
darin.moz
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
XMLHttpRequests leak about 5KB/request in current Mozilla/Firefox trunk builds. This is a regression from earlier builds. Firefox 1.0 e.g. only leaks requests if the network is down (a bug in itself). A testcase is at http://www.croczilla.com/~alex/req/req.html. The testcase generates aynchronous XMLHttpRequests and lets you adjust the interval between requests & the page requested. For current trunk builds on Windows the leak rate at the default interval (50ms) is about 100KB/s. FF1.0 will not leak if the network is up and running (even if the requested page doesn't exist). If you unplug your network connection, however, it also starts leaking.
Reporter | ||
Comment 1•20 years ago
|
||
A little further investigation shows that it is the nsXMLHttpRequest objects themselves that are leaking. The leak doesn't seem to have anything to do with onload, etc. listeners, and it only occurs if send() is called on the request object.
Reporter | ||
Comment 2•20 years ago
|
||
Turns out this is a regression caused by bug#261083. If nsHttpChannel::SetNotificationCallbacks() is called with nsnull, we must make sure to null-out mHttpEventSink & mProgressSink as well, or otherwise we end up with a reference cycle nsHttpChannel <--> nsXMLHttpRequest.
Reporter | ||
Updated•20 years ago
|
Attachment #173214 -
Flags: review?(darin)
Comment 3•20 years ago
|
||
Hmm... this works, but I think it might be better to release those objects in nsHttpChannel::OnStopRequest once we know that we will no longer need them. Can you give that a try?
Updated•20 years ago
|
Keywords: regression
Reporter | ||
Comment 4•20 years ago
|
||
How about this?
Attachment #173214 -
Attachment is obsolete: true
Attachment #173220 -
Flags: review?(darin)
Reporter | ||
Updated•20 years ago
|
Attachment #173214 -
Flags: review?(darin)
Comment 5•20 years ago
|
||
Comment on attachment 173220 [details] [diff] [review] 2nd try r=darin
Attachment #173220 -
Flags: review?(darin) → review+
Comment 6•20 years ago
|
||
Comment on attachment 173220 [details] [diff] [review] 2nd try sr=bzbarsky
Attachment #173220 -
Flags: superreview+
Reporter | ||
Comment 7•20 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•