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

UNCONFIRMED
Unassigned

Status

()

Core
Canvas: 2D
UNCONFIRMED
3 years ago
2 years ago

People

(Reporter: Stanislaw Osinski, Unassigned, NeedInfo)

Tracking

29 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink:P2])

Attachments

(3 attachments)

(Reporter)

Description

3 years ago
Created attachment 8431108 [details]
svg-canvas-high-memory.zip

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.

Comment 1

3 years ago
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.

Comment 3

3 years ago
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]

Comment 4

3 years ago
Created attachment 8438188 [details]
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.

Comment 5

3 years ago
Created attachment 8438190 [details]
about:memory of a new profile

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.

Comment 6

3 years ago
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?

Comment 7

3 years ago
Related to bug 1006353 (fixed by bug 1060200)?

Comment 8

2 years ago
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/
You need to log in before you can comment on or make changes to this bug.