Closed Bug 1238328 Opened 8 years ago Closed 8 years ago

Increase memory consumption SVG pie chart when mouse move over it

Categories

(Core :: Graphics, defect)

46 Branch
Unspecified
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla46
Tracking Status
firefox45 --- unaffected
firefox46 --- verified

People

(Reporter: alice0775, Assigned: bas.schouten)

References

(Depends on 1 open bug, )

Details

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

Attachments

(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.

STR
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
Status: NEW → ASSIGNED
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

https://reviewboard.mozilla.org/r/30337/#review27171
https://hg.mozilla.org/mozilla-central/rev/c88ad0a6f5df
Status: ASSIGNED → RESOLVED
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.
https://hg.mozilla.org/mozilla-central/rev/6020a4cb41a77a09484c24a5875bb221714c0e6a
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.
https://hg.mozilla.org/mozilla-central/rev/e790bba372f14241addda469a4bdb7ab00786ab3
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.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: