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!
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.
You need to log in before you can comment on or make changes to this bug.