Closed Bug 1238328 Opened 8 years ago Closed 8 years ago

Increase memory consumption SVG pie chart when mouse move over it


(Core :: Graphics, defect)

46 Branch
Windows 7
Not set



Tracking Status
firefox45 --- unaffected
firefox46 --- verified


(Reporter: alice0775, Assigned: bas.schouten)


(Depends on 1 open bug, )


(Keywords: memory-footprint, regression, Whiteboard: [gfx-noted])


(5 files)

[Tracking Requested - why for this release]:

+++ This bug was initially created as a clone of Bug #1238250 +++

This happens Nightly46.0a1, but not on Aurora45.0a2.

1. open attachment 8705975 [details]
2. mouse move over SVG pie chart for a while

Actual Results:
Increase memory consumption in a very short time. about 30MB/sec

Expected Results:
not so
Attached file before mousemove
Attached file about:support
Attached file memory-report.json.gz
this is with e10s turned off. The windows task manager shows firefox.exe taking 2.1GB memory.
Assignee: nobody → bas
Flags: needinfo?(bas)
Whiteboard: [gfx-noted]
So this SVG does an insane amount of push/poplayers, each one seems to add just a little bit of GPU memory usage but they only get cleared when the DrawTarget is destroyed, this seems like D2D being very suboptimal, I'm investigating.
Upon further investigation it is observed that this memory increase is not the result of the PushLayer/PopLayer itself, or the rendering of the command list to the context, it is rather the result of drawing to the command list. I suspect drawing to a command list generates some sort of intermediate GPU resources for the command list that aren't cleared when the last reference to the command list is released.
Extensive investigation into why this happens shows that D2D will internally maintain references to any command lists that -have- been used with a certain device context, until EndDraw is called on that device context. Since command lists will hold on to resources used to draw to them that can cause quite a growth in memory usage. A 'simple' fix would be to on a flush do an End/BeginDraw pair instead of just a flush. I've done a try push to see how this will affect performance. If the performance implications are too severe we can keep track of how many command lists have been pushed and only do an End/BeginDraw above a certain threshold.
Attachment #8706391 - Flags: review?(jmuizelaar) → review+
Comment on attachment 8706391 [details]
MozReview Request: Bug 1238328: Purge stored command lists by calling EndDraw/BeginDraw on a regular basis when they're used. r=jrmuizel
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Alice, can you please confirm this is fixed in tomorrow's Nightly build?
Flags: needinfo?(alice0775)
Reproduced on Nightly 2016-01-11 build.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 ID:20160111030207

And I can verify that the problem is fixed on Nightly 2016-01-12 build.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 ID:20160112030227
Flags: needinfo?(alice0775)
Thanks for your help, Alice.
You need to log in before you can comment on or make changes to this bug.