Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 5.1.1
-
Fix Version/s: 5.1.2
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:any
-
Support Case References:Support case #13182 - https://icesoft.my.salesforce.com/5007000000tjmp5
Description
The DeviceCMYK and ICCBased colour space classes have caches for colours that have been calculated into RGB. A client expressed concern that the DeviceCMYK class is not freeing up its memory. This in-particular is an issue as the server environment has a very long uptime and the cache is never emptied.
On closer inspection, the DeviceCMYK cache is static which will be a memory issue. And the ICCBased class has a logic error, the class has static cache but instantiates a new instance in the constructor.
On closer inspection, the DeviceCMYK cache is static which will be a memory issue. And the ICCBased class has a logic error, the class has static cache but instantiates a new instance in the constructor.
Moved the caches to a local instance of the color space. This should address the buildup of the cache on a long running server. A weak reference cache could be introduced but I think that having a cache per document's colour space will still speed up image decode without taking up a log of memory.