New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 158931 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Nov 2012
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

fix leak in windows PlatformBitmap

Project Member Reported by reed@chromium.org, Nov 1 2012

Issue description

Recent memory usage increase points to a leak in PlatformBitmap on windows.

http://build.chromium.org/f/chromium/perf/chromium-rel-win7-dual/memory/report.html?history=100&rev=161245&graph=vm_peak_b

Upon inspection, I think that windows PlatformBitmap is leaking its DIBSection, as it only frees its HDC in its destructor.

 

Comment 1 by reed@chromium.org, Nov 1 2012

Cc: bunge...@chromium.org mal@google.com dharani@google.com tonyg@google.com
Owner: reed@google.com

Comment 2 by dharani@google.com, Nov 1 2012

Labels: -Pri-2 -Area-Skia Pri-1 Area-Internals Mstone-24 ReleaseBlock-Stable Internals-Skia
Status: Assigned
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 1 2012

The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=165424

------------------------------------------------------------------------
r165424 | reed@google.com | 2012-11-01T17:50:20.070644Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/skia/ext/bitmap_platform_device_win.cc?r1=165424&r2=165423&pathrev=165424
   M http://src.chromium.org/viewvc/chrome/trunk/src/skia/ext/platform_canvas.cc?r1=165424&r2=165423&pathrev=165424
   M http://src.chromium.org/viewvc/chrome/trunk/src/skia/ext/platform_canvas.h?r1=165424&r2=165423&pathrev=165424

Free the dibsection (HBITMAP) in PlatformBitmap's destructor, so we don't leak!

This adds an extra slot to PlatformBitmap, which is implemented for all platforms. To
do this simply, an intptr_t field is added (platform_extra_) which is initialized to 0.
At the moment, only the windows port uses this, but there is no cost to the other ports.

BUG= 158931 
Review URL: https://codereview.chromium.org/11293036
------------------------------------------------------------------------
Holy crap.  Nice catch.

Comment 6 by dharani@google.com, Nov 2 2012

Labels: Merge-Approved
reed@: Please merge the fix to 1312 branch.
Cc: reed@google.com
Owner: epoger@chromium.org
taking ownership; I will merge into the 1312 branch.
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 5 2012

Labels: -Merge-Approved merge-merged-1312
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=165954

------------------------------------------------------------------------
r165954 | epoger@google.com | 2012-11-05T18:03:06.649229Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1312/src/skia/ext/bitmap_platform_device_win.cc?r1=165954&r2=165953&pathrev=165954
   M http://src.chromium.org/viewvc/chrome/branches/1312/src/skia/ext/platform_canvas.cc?r1=165954&r2=165953&pathrev=165954
   M http://src.chromium.org/viewvc/chrome/branches/1312/src/skia/ext/platform_canvas.h?r1=165954&r2=165953&pathrev=165954

Merge 165424 - Free the dibsection (HBITMAP) in PlatformBitmap's destructor, so we don't leak!

This adds an extra slot to PlatformBitmap, which is implemented for all platforms. To
do this simply, an intptr_t field is added (platform_extra_) which is initialized to 0.
At the moment, only the windows port uses this, but there is no cost to the other ports.

BUG= 158931 
Review URL: https://codereview.chromium.org/11293036

TBR=reed@google.com
Review URL: https://codereview.chromium.org/11365092
------------------------------------------------------------------------
Status: Fixed
I'll keep an eye on https://goto.google.com/betabuilders and make sure this didn't cause trouble...
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Area-Internals -Mstone-24 -Internals-Skia Cr-Internals-Skia Cr-Internals M-24

Sign in to add a comment