Closed
Bug 809587
Opened 13 years ago
Closed 13 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•13 years ago
|
Whiteboard: [MemShrink]
They do not.
| Assignee | ||
Updated•13 years ago
|
Summary: Does taking blob screenshots increment the JS malloc counter? → canvas.toBlob() doesn't increment the JS malloc counter
| Assignee | ||
Comment 2•13 years ago
|
||
Attachment #679397 -
Flags: review?(khuey)
| Assignee | ||
Comment 3•13 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•13 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•13 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•13 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•13 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•13 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•13 years ago
|
||
Thanks, Kyle.
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/284ad66e8bda
Comment 10•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment 11•13 years ago
|
||
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•