Bug 49621 - image session context lacks control over retained sources leading to excessive memory usage by image sources
Summary: image session context lacks control over retained sources leading to excessiv...
Status: CLOSED DUPLICATE of bug 53046
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: All All
: P3 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 07:12 UTC by Dominik Stadler
Modified: 2012-04-30 00:20 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Stadler 2010-07-20 07:12:55 UTC
FOUserAgent holds an element “imageSessionContext” which holds SoftReferences to Source/ImageSource elements via AbstractImageSessionContext.sessionSources. The memory for these items is cleaned correctly when we un-reference the FOUserAgent object, however the Source-items still hold a file-handle via the InputStream that is included in StreamSource/ImageStreamSource object. The effect is that I cannot remove intermediate image files that are used during PDF generation right after generation is done.

So file handles are kept open this way and are only given up, when the SoftReference is collected internally. So this can easily cause “out of handle” type of errors if a lot of memory is available and thus SoftReferences are not collected for a long time.

Furthermore it hinders cleanup of image files after report generation, i.e. when they are created specifically for the report and should be removed afterwards. This is especially true on platforms which lock open files and do not allow cleanup of those files, e.g. Windows.

See also discussion at http://www.mail-archive.com/fop-users%40xmlgraphics.apache.org/msg15411.html
Comment 1 Glenn Adams 2012-04-07 01:37:32 UTC
resetting severity from major to normal pending further review
Comment 2 Glenn Adams 2012-04-07 01:42:13 UTC
resetting P2 open bugs to P3 pending further review
Comment 3 Glenn Adams 2012-04-07 19:12:00 UTC
there is no "bug" here, i.e., there are no leaked file descriptors; however, the XGC image session context does not provide mechanisms for programmatic control over retained image source memory

so this is effectively an enhancement request to XGC, as such it is not an FOP bug per se, but an XGC issue;
Comment 4 Glenn Adams 2012-04-07 19:15:31 UTC

*** This bug has been marked as a duplicate of bug 53046 ***
Comment 5 Glenn Adams 2012-04-30 00:20:43 UTC
batch transition resolved+duplicate to closed+duplicate