Closed Bug 781380 Opened 12 years ago Closed 12 years ago

[Azure] Memory leak in Azure/Cairo

Categories

(Core :: Graphics: Canvas2D, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: ajones, Assigned: ajones)

References

()

Details

Attachments

(2 files, 1 obsolete file)

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.
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?(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().
Attachment #650363 - Flags: review?(karlt)
Created an internal init method that doesn't call cario_surface_reference()
Attachment #650363 - Attachment is obsolete: true
Attachment #650711 - Flags: review?(roc)
(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
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
https://hg.mozilla.org/mozilla-central/rev/c97a0ffcf500
https://hg.mozilla.org/mozilla-central/rev/e137f28dfe70
Status: ASSIGNED → RESOLVED
Closed: 12 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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: