Open Bug 1017847 Opened 10 years ago Updated 2 years ago

High memory usage when drawing SVG images of varying sizes on a canvas

Categories

(Core :: Graphics: Canvas2D, defect)

29 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: stanislaw.osinski, Unassigned)

Details

(Whiteboard: [MemShrink:P2])

Attachments

(3 files)

Drawing the same SVG images onto canvas multiple times, but each time scaled to a different size results in sky-rocketing memory usage. When starting Firefox with one empty tab, the memory usage (taken from Windows Task Manager) is around 200 MB. When running the attached code, the memory usage jumps to 1.5 GB. After the animation stops, refreshing the page further increases the memory footprint to about 2.5 GB. After a while of inactivity the memory footprint drops back to ~300 MB.
Is this related to the work over in bug 999931?
Whiteboard: [MemShrink]
It's related, but not the same. This sounds more like excessive caching in imagelib rather than the SVG document taking up lots of memory.
about:memory shows the imagelib-surface-cache at 13.29 MB. I can't reproduce the 1.5 GB jump reported. 

Stanislaw: Can we get an about:memory report from your machine? See this page for how to do that:
https://wiki.mozilla.org/Performance/MemShrink/about:memory
Flags: needinfo?(stanislaw.osinski)
Whiteboard: [MemShrink] → [MemShrink:P2]
Attached file about:memory
I can confirm comment 1 . Initial memory was ~600MB. With the testcase attached, the memory quickly increased to ~2.4GB , then Windows gave a "memory low" warning, and then the memory dropped to 1.8GB . 
I then took a memory report, and after about a minute, the memory dropped to almost the original 600MB.

Attaching the memory report.
about:memory from a new profile. 

I noticed through the task-manager that the memory increases in roughly this cycle : increase by 200 Mb , decrease by 150MB.

Also, shutting Nightly took a long time when the memory usage was ~1.6GB . It took about 10 seconds on a SSD.
From comment 4, the explicit memory usage is only at 394MB, but resident size is at 1.9GB.  What is mapping ~1.5GB of pages?
Related to bug 1006353 (fixed by bug 1060200)?
Hi, is there any news on this ?

It's not only with SVG, but with any kind of images, I made a jsfiddle that show that memomy leak: https://jsfiddle.net/KeitIG/aw1hn93z/
Severity: normal → S3

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit auto_nag documentation.

Flags: needinfo?(stanislaw.osinski)

Memory use does not seem to increase for me with the testcase.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: