Closed
Bug 809587
Opened 11 years ago
Closed 11 years ago
canvas.toBlob() doesn't increment the JS malloc counter
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
People
(Reporter: justin.lebar+bug, Assigned: justin.lebar+bug)
References
Details
(Whiteboard: [MemShrink][soft-blocker])
Attachments
(1 file, 2 obsolete files)
1.80 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
There's a JS malloc counter which we should increment every time we do a big allocation; it affects how often the GC gets run. Are we incrementing this counter when we take a blob screenshot (i.e., when we do canvas.toBlob)? If not, we should be.
Assignee | ||
Updated•11 years ago
|
Whiteboard: [MemShrink]
They do not.
Assignee | ||
Updated•11 years ago
|
Summary: Does taking blob screenshots increment the JS malloc counter? → canvas.toBlob() doesn't increment the JS malloc counter
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #679397 -
Flags: review?(khuey)
Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 679397 [details] [diff] [review] Patch, v1 Heh, I didn't actually compile this > + if (context) { if (cx)
Assignee | ||
Comment 4•11 years ago
|
||
Increment the malloc counter in one other place. This covers all instances of nsDOMMemoryFile, which I guess is what we want?
Attachment #679397 -
Attachment is obsolete: true
Attachment #679397 -
Flags: review?(khuey)
Attachment #679400 -
Flags: review?(khuey)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → justin.lebar+bug
Comment on attachment 679400 [details] [diff] [review] Patch, v2 Review of attachment 679400 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/html/content/src/nsHTMLCanvasElement.cpp @@ +682,5 @@ > > + JSContext* cx = nsContentUtils::GetCurrentJSContext(); > + if (cx) { > + JS_updateMallocCounter(cx, imgSize); > + } Why are you doing this twice here?
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #5) > Comment on attachment 679400 [details] [diff] [review] > Patch, v2 > > Review of attachment 679400 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: content/html/content/src/nsHTMLCanvasElement.cpp > @@ +682,5 @@ > > > > + JSContext* cx = nsContentUtils::GetCurrentJSContext(); > > + if (cx) { > > + JS_updateMallocCounter(cx, imgSize); > > + } > > Why are you doing this twice here? Because I was writing a code during a meeting.
Assignee | ||
Comment 7•11 years ago
|
||
Now with less less repetition.
Attachment #679400 -
Attachment is obsolete: true
Attachment #679400 -
Flags: review?(khuey)
Attachment #679461 -
Flags: review?(khuey)
Attachment #679461 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 8•11 years ago
|
||
Soft basecamp blocker because this should help us purge screenshots out of the heap more quickly and because it's a low-risk change.
blocking-basecamp: --- → +
Whiteboard: [MemShrink] → [MemShrink][soft-blocker]
Assignee | ||
Comment 9•11 years ago
|
||
Thanks, Kyle. remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/284ad66e8bda
Comment 10•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/284ad66e8bda
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment 11•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/bbdbb8b0cef8
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
Updated•4 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•