Note: There are a few cases of duplicates in user autocompletion which are being worked on.

[Azure] Memory leak in Azure/Cairo

RESOLVED FIXED in mozilla17

Status

()

Core
Canvas: 2D
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: kentuckyfriedtakahe, Assigned: kentuckyfriedtakahe)

Tracking

Trunk
mozilla17
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

Azure/Cairo content leaks substantial amounts of memory upon completion of the maze. This was traced back to cairo surface memory leak in DrawTargetCairo::CreateSimilarDrawTarget() which is called frequently in Canvas code.
Created attachment 650363 [details] [diff] [review]
Fixed cairo surface memory leak in DrawTargetCairo::CreateSimilarDrawTarget()
Attachment #650363 - Flags: review?(ncameron)
Note that Init() calls cairo_surface_reference() so the call to cairo_surface_destroy() cancels that out.
Attachment #650363 - Flags: review?(ncameron) → review?(roc)
Attachment #650363 - Flags: review?(roc)
Attachment #650363 - Flags: review?(karlt)
Can't we just change Init() to not add a reference to the surface?
That would be another option but it would change the meaning of Init(). This would mean Factory::CreateDrawTargetForCairoSurface() would need to call cairo_surface_reference() before calling Init(). This would spread the reference counting logic across files.

Avoiding the extra reference/destroy could be achieved by creating an internal version of the Init() function which doesn't call cairo_surface_reference().
Let's do that then.
Attachment #650363 - Flags: review?(karlt)
Created attachment 650711 [details] [diff] [review]
Fixed cairo surface memory leak in DrawTargetCairo::CreateSimilarDrawTarget() v2

Created an internal init method that doesn't call cario_surface_reference()
Attachment #650363 - Attachment is obsolete: true
Attachment #650711 - Flags: review?(roc)
Attachment #650711 - Flags: review?(roc) → review+
Created attachment 651879 [details] [diff] [review]
Fixed cairo surface memory leak in DrawTargetCairo::DrawSurfaceWithShadow()

Missing cairo_surface_destroy call.
Attachment #651879 - Flags: review?(roc)
Attachment #651879 - Flags: review?(roc) → review+
https://tbpl.mozilla.org/?tree=Try&rev=09e71b199e6b
Keywords: checkin-needed
(In reply to Anthony Jones (:kentuckyfriedtakahe) from comment #8)
> https://tbpl.mozilla.org/?tree=Try&rev=09e71b199e6b

This is showing Windows XP gfxASurface leaks, no?
Keywords: checkin-needed
Blocks: 781371
https://tbpl.mozilla.org/?tree=Try&rev=f495fefb620a
Resubmitted to try without the faulty patch (from another bug). Note that the DrawTargetCairo code path affected by these patches is yet to be enabled on Linux.
Whiteboard: checkin-needed
(In reply to Anthony Jones (:kentuckyfriedtakahe) from comment #10)
> https://tbpl.mozilla.org/?tree=Try&rev=f495fefb620a

Green on Try.

https://hg.mozilla.org/integration/mozilla-inbound/rev/c97a0ffcf500
https://hg.mozilla.org/integration/mozilla-inbound/rev/e137f28dfe70
Flags: in-testsuite-
Whiteboard: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c97a0ffcf500
https://hg.mozilla.org/mozilla-central/rev/e137f28dfe70
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Apparently part of this fix got lost in the original landing. Landed a follow-up for it.

https://hg.mozilla.org/integration/mozilla-inbound/rev/625f746bedf9
And on aurora too.
https://hg.mozilla.org/releases/mozilla-aurora/rev/02ba8b87cc48
https://hg.mozilla.org/mozilla-central/rev/625f746bedf9
You need to log in before you can comment on or make changes to this bug.