qcms_transform_precacheLUT_float leaks when ICCv4 enabled with gfx.color_management.enablev4 set to true

NEW
Unassigned
(NeedInfo from)

Status

()

Core
GFX: Color Management
4 years ago
3 months ago

People

(Reporter: kinetik, Unassigned, NeedInfo)

Tracking

Trunk
x86_64
Windows 8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink:P2])

(Reporter)

Description

4 years ago
For quite some time I've been seeing address space exhaustion when retaining a session over 2-3 days in my nightly build that appeared in about:memory as heap-unclassified.  I finally had a chance to run a DMD-enabled build and discovered the memory allocated by qcms_transform_precacheLUT_float is not freed in the qcms_transform_release call path.  This shows up in dmd.out as variants of the following call stack:

Unreported: 600 blocks in stack trace record 1 of 1,772
 260,505,600 bytes (258,746,400 requested / 1,759,200 slop)
 42.23% of the heap (42.23% cumulative);  55.17% of unreported (55.17% cumulative)
 Allocated at
   malloc_impl (d:\work\mozilla-opt\memory\build\replace_malloc.c:152) 0x71b851a2
   qcms_transform_precacheLUT_float (d:\work\mozilla-opt\gfx\qcms\transform.c:1163) 0x68678faa
   qcms_transform_create (d:\work\mozilla-opt\gfx\qcms\transform.c:1243) 0x6867576e
   mozilla::image::nsJPEGDecoder::WriteInternal (d:\work\mozilla-opt\image\decoders\nsjpegdecoder.cpp:343) 0x5c1bbd53
   mozilla::image::Decoder::Write (d:\work\mozilla-opt\image\src\decoder.cpp:113) 0x5c1aee55
   mozilla::image::RasterImage::WriteToDecoder (d:\work\mozilla-opt\image\src\rasterimage.cpp:2223) 0x5c1a4d08

Disabling gfx.color_management.enablev4 avoids the problem.

Secondary to the leak, qcms's allocations are not tracked by our tools and thus made finding this bug harder than it could have been.
(In reply to Matthew Gregan [:kinetik] from comment #0)
> Secondary to the leak, qcms's allocations are not tracked by our tools and
> thus made finding this bug harder than it could have been.

This is bug 964031. I had the beginnings of a patch there for the qcms part but didn't hook it up to anything (kinda dropped the ball there). I didn't realize these were actually being leaked though!
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink:P2]
Flags: needinfo?(milan)
Seth, I realize you may be swamped with the SurfaceCache work, but this seems reasonably up your alley. Any chance you could have a look at this? I'd love for bug 964031 to be fixed as well (I worked on the qcms side a bit but realized I had no idea how to thread the information up to image decoding), but that's probably more work.
Flags: needinfo?(seth)
Duplicate of this bug: 1111204
Flags: needinfo?(milan)
You need to log in before you can comment on or make changes to this bug.