Details
-
Type: Bug
-
Status: Closed
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: 4.0.1
-
Fix Version/s: 4.2
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:any
-
Assignee Priority:P1
-
ICEsoft Forum Reference:
Description
The pdf posted on the forum exhibits a new or at least unreported memory leak with the ImageCache. The community members testing seems to indicate the issue has been around since at least 4.0.1. I took a little time yesterday to profile the application during the file load it looks like the ImageCache object isn't release it's buffered image reference or from another point of view the object isn't disposed off with the rest of the form object.
My guess is that we aren't cleaning up correctly wen a pages xObject is disposed during a page dispose. It would explain why we aren't hearing a lot of noise about this issue from our supported customers.
My guess is that we aren't cleaning up correctly wen a pages xObject is disposed during a page dispose. It would explain why we aren't hearing a lot of noise about this issue from our supported customers.
It turns out that when an Xobject image or form is called from another Xobject the resulting base stream is never disposed off. So PDF like the provided samples will blead memory that we can never clean up.
I've updated the ContentParser so that it calls a special dispose method on for form Xobjects which clean up any orphaned resources. The image Xobjects had to have the clean up on the Resource.getImage call.
I've done a quite a bit of testing here and the leak seams to be resolved. It has become apparent that the ImageCache class is no longer needed needed as most of it's functionality has been disabled, something to touch up in the major release.