WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
20315
Memory leak with Canvas getImageData
https://bugs.webkit.org/show_bug.cgi?id=20315
Summary
Memory leak with Canvas getImageData
James Urquhart
Reported
2008-08-07 02:06:39 PDT
I seem to be getting a rather predictable memory "leak" when using getImageData() on a 2d Canvas Rendering Context. Basically in my test case, i am calling putImageData(getImageData(...), ...) every chance i can get. Memory usage climbs well into the 1 <-> 2gb range. It should be noted that this occurs in other browsers too, though with varying cut-off points (presumably when the garbage collection finally kicks in). However it should also be noted that i am essentially running the same code in a real app, i don't seem to encounter this issue (in WebKit
r35620
). For reference, i have put a copy of this up at the following URL:
http://www.cuppadev.co.uk/hiscumm/webkit-canvas-mem/js_test.html
(search for "fastPaletteRemap" if you want the meat of it) As for why this is, i am really stumped. So i can't really rely on it. Any insight would be appreciated of course. :)
Attachments
Fixeration
(14.28 KB, patch)
2008-10-01 21:41 PDT
,
Oliver Hunt
mjs
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2008-09-30 20:41:27 PDT
Ouch.
Geoffrey Garen
Comment 2
2008-09-30 20:44:44 PDT
JSImageData::JSImageData just needs to call JSC::Heap::reportExtraCost.
Oliver Hunt
Comment 3
2008-09-30 21:41:46 PDT
JSCanvasPixelArrayCustom already does that -- i suppose if you never used the CPA that would achieve this result but, if you ever did touch it it would report... Hmmmm -- i wonder if we ever get rid of the cached wrapper though?
Oliver Hunt
Comment 4
2008-10-01 21:41:30 PDT
Created
attachment 24004
[details]
Fixeration Fix
Maciej Stachowiak
Comment 5
2008-10-01 21:43:02 PDT
Comment on
attachment 24004
[details]
Fixeration r=me
Oliver Hunt
Comment 6
2008-10-01 22:02:54 PDT
Committing to
http://svn.webkit.org/repository/webkit/trunk
... D WebCore/bindings/js/JSCanvasPixelArrayCustom.cpp M WebCore/ChangeLog M WebCore/WebCore.xcodeproj/project.pbxproj A WebCore/bindings/js/JSImageDataCustom.cpp M WebCore/bindings/scripts/CodeGeneratorJS.pm M WebCore/html/CanvasPixelArray.idl M WebCore/html/ImageData.idl Committed
r37181
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug