Closed Bug 681620 Opened 14 years ago Closed 14 years ago

Memory problem when draw image on canvas

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: andrey.mir, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0 Build ID: 20110811165603 Steps to reproduce: In the project I'm working on now user can drop a bunch images and see previews of the images. With the URL.createObjectURL API I load dropped images and draw them on canvas. It works fine except one thing. The Firefox seems to keep the large original image in memory all the time. Here is the demo http://jsfiddle.net/v3rEt/2/embedded/result/ . Drop images on the page and click start button. In my test Firefox consumes > 1.2 Gb memory for about 100 files. But when I tested the same page with the same files in IE 10 Platform Preview it consumes only 80 Mb memory. Is there a memory leak in the Firefox which prevents image files to be unloaded after I don't need them?
about:memory: Explicit Allocations 1,227.04 MB (100.0%) -- explicit ├──1,146.31 MB (93.42%) -- heap-unclassified ├─────42.43 MB (03.46%) -- images │ ├──42.09 MB (03.43%) -- content │ │ ├──42.09 MB (03.43%) -- used │ │ │ ├──31.90 MB (02.60%) -- uncompressed │ │ │ └──10.19 MB (00.83%) -- raw │ │ └───0.00 MB (00.00%) -- (1 omitted) │ └───0.34 MB (00.03%) -- (1 omitted) ├─────24.63 MB (02.01%) -- js │ ├──18.00 MB (01.47%) -- gc-heap │ └───6.63 MB (00.54%) -- (4 omitted) ├─────12.36 MB (01.01%) -- storage │ └──12.36 MB (01.01%) -- sqlite │ ├───7.21 MB (00.59%) -- places.sqlite │ │ ├──6.96 MB (00.57%) -- cache-used │ │ └──0.25 MB (00.02%) -- (2 omitted) │ └───5.15 MB (00.42%) -- (13 omitted) └──────1.30 MB (00.11%) -- (1 omitted) Other Measurements 1,326.83 MB -- resident 1,311.48 MB -- private 1,230.62 MB -- heap-committed 1,222.72 MB -- heap-used 852.45 MB -- gfx-surface-image 852.17 MB -- gfx-d2d-surfacecache 37.28 MB -- heap-unused 10.83 MB -- gfx-d2d-surfacevram 2.76 MB -- heap-dirty 2.32 MB -- canvas-2d-pixel-bytes 0.00 MB -- gfx-surface-win32
Have the same problem in Google Chrome 13, but seems to be fixed in latest developer releases.
Have you tried with the Nightly builds? If the problem persists, could you copy/paste about:memory output from the Nightly build?
Whiteboard: [MemShrink]
I can't reproduce this with the link on 6.0 or on Nightlies ...
Just checked in 9.0a1 (2011-08-24). Work fine. When the page loaded the memory was 70. Then I drop 100 *.jpg files (total size ~900 MB) and click "start". The memory grows up to ~500 and stays there. After all images was added to the page the memory decreases down to 150 MB. So I think the nightly builds are not affected.
Andrey, I'm marking this bug "Works for me" given that the Nightly build isn't affected.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
OS: Windows 7 → All
Hardware: x86_64 → All
Resolution: --- → WORKSFORME
Whiteboard: [MemShrink]
Version: 6 Branch → Trunk
You need to log in before you can comment on or make changes to this bug.