Closed Bug 598851 Opened 14 years ago Closed 14 years ago

HUDService's ResponseListener eats all my memory

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(blocking2.0 betaN+)

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: kinetik, Assigned: msucan)

References

Details

(Keywords: crash, crashreportid, Whiteboard: [patchclean:1012])

Attachments

(1 file, 1 obsolete file)

Activating Web Console on a page that starts fetching a large resource over HTTP (e.g. a 1GB video) results in significant memory consumption due to HUDService's ResponseListener storing a copy of the incoming data in a string. If I right-click on the network log message in the console, "Log Request and Response Bodies" is not checked.
Summary: HUDService's ResponseListener eats all my memory and insults my mother → HUDService's ResponseListener eats all my memory
(In reply to comment #0) > Activating Web Console on a page that starts fetching a large resource over > HTTP (e.g. a 1GB video) results in significant memory consumption due to > HUDService's ResponseListener storing a copy of the incoming data in a string. > If I right-click on the network log message in the console, "Log Request and > Response Bodies" is not checked. What, No patch?
(In reply to comment #0) > Activating Web Console on a page that starts fetching a large resource over > HTTP (e.g. a 1GB video) We will need to set a max size when checking requests where we discard the content. Or perhaps by content-type? I imagine some JPEGs will also eat memory pretty badly.
Does the fix in bug 597502 help at all? E.g., could you retest with the latest minefield nightly for your system? (e.g., http://nightly.mozilla.org/) Also, some additional test case information (like an example URL) would be helpful. thanks for the report!
That bug sounds like the same problem, but it's not. In this case, the problem is simply the amount of data accumulated in the receiveData string on the ResponseListener as it arrives. Discarding it after the request has finished (as bug 597502 does) doesn't help because, with a large enough request, it's possible to run out of memory before the request completes. Here's an easy way to reproduce: 1. Serve a large file and a page containing a download link with a local HTTP server. I created a large fake zip file using: dd if=/dev/zero of=huge.zip bs=102400 count=10240 2. Visit download page. I used: <a href="huge.zip">download me</a> 3. Open Web Console. 4. Click download link. 5. Watch Firefox's RSS (private memory) grow to ~2.3GB.
there may be something to this. I just tried duplicating your test and watched my memory balloon up to about 2GB and then firefox crashed. crash report here: http://crash-stats.mozilla.com/report/index/bp-29f38ad4-fbfe-4cfc-86d6-1add42100924 4.0b6, MacOS X 10.6 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b6) Gecko/20100101 Firefox/4.0b6
Keywords: crash, crashreportid
OS: Linux → All
Hardware: x86_64 → All
looks like that crash may have been fixed on nightlies. Need more testing there. Regardless, this is going to be a problem. It did seem to clean up after itself during a previous run when I canceled the download and closed the tab. Memory dropped back to what it was before the test.
requesting blocking final.
blocking2.0: --- → ?
blocking2.0: ? → betaN+
Blocks: devtools4b8
Assignee: nobody → mihai.sucan
Assignee: mihai.sucan → rcampbell
Status: NEW → ASSIGNED
Assignee: rcampbell → mihai.sucan
Attached patch proposed patch (obsolete) — Splinter Review
Proposed patch. Once I apply this, I can't see any more problems with memory usage. I can download, say, an Ubuntu CD ISO without memory usage spikes. The test code change I did is ... minimal, because the httpActivity.response.listener object is now emptied once a request stops. So, I can't check if receivedData is emptied or not. I think just checking if response.listener is cleared is enough. Suggestions for improvements are welcome!
Attachment #481546 - Flags: feedback?(rcampbell)
Comment on attachment 481546 [details] [diff] [review] proposed patch I don't see much to improve there. That's pretty much how I was going to do it.
Attachment #481546 - Flags: feedback?(rcampbell) → feedback+
Comment on attachment 481546 [details] [diff] [review] proposed patch Thanks Robert for your feedback+! Asking for review from Dietrich.
Attachment #481546 - Flags: review?(dietrich)
Attachment #481546 - Flags: review?(dietrich) → review+
Keywords: checkin-needed
Whiteboard: [patchclean:1007]
Thanks Dietrich for the review+!
Attached patch rebased patchSplinter Review
Rebased patch. One liner change, hehe.
Attachment #481546 - Attachment is obsolete: true
Whiteboard: [patchclean:1007] → [patchclean:1012]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: