You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Yachun Miao (JIRA)" <ji...@apache.org> on 2017/07/22 09:35:00 UTC

[jira] [Commented] (PDFBOX-2323) More flexible image caching (OOM)

    [ https://issues.apache.org/jira/browse/PDFBOX-2323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16097198#comment-16097198 ] 

Yachun Miao commented on PDFBOX-2323:
-------------------------------------

But use SoftReference will result in JVM full gc frequently. It is better make it optional, user can decide use imgae cache or not. In some case, the PDImageXObject.getImage() will only be called once, but the image is forcely be cached as softreference

> More flexible image caching (OOM)
> ---------------------------------
>
>                 Key: PDFBOX-2323
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2323
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel, Rendering
>    Affects Versions: 2.0.0
>            Reporter: John Hewson
>            Assignee: John Hewson
>             Fix For: 2.0.0
>
>         Attachments: PDFBOX-2323-245999-p7-outofmemory.pdf
>
>
> Image caching in PDImageXObject can cause very high memory usage which has resulted in issues PDFBOX-2313, PDFBOX-2310, PDFBOX-2101. Images are just so large that the current "on size fits all" caching isn't working well.
> Pushing responsibility for caching down to callers of PDImage#getImage() would allow for use-case specific caching strategies, for example PDFRenderer could cache small images for the duration of a document being rendered, rather than having to re-create the PDImageXObject again for every page on which it appears. Likewise caching of large images could be limited to a single page, or not at all.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org