[
https://issues.apache.org/jira/browse/PDFBOX-5530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17745644#comment-17745644
]
Andreas Lehmkühler commented on PDFBOX-5530:
--------------------------------------------
{quote}Because the document corresponding to this question always has 100,000
obj numbers, it corresponds to a currentPage of almost 100,000, that is,
100,000 * 4256 bytes = 405M{quote}
Not all of those objects are COSStreams, so that the calculation may not be
correct
{quote}Obtaining the number of COSStream is to roughly calculate the memory
size occupied by PDDocument{quote}
The number of COSStreams doesn't say anything about the used memory, e.g. the
pdf from PDFBOX-3712 is about 46M and contains a little bit more than 100
objects. Doesn't look that critical w.r.t the estimated memory consumption, but
one of the streams has a decompressed size of 3.1G
> Java heap space
> ---------------
>
> Key: PDFBOX-5530
> URL: https://issues.apache.org/jira/browse/PDFBOX-5530
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.25
> Reporter: liu
> Priority: Blocker
> Attachments: image-2022-10-20-14-30-19-790.png,
> image-2022-10-20-14-30-57-332.png, image-2022-10-20-14-32-10-258.png,
> image-2022-10-20-15-01-06-688.png, image-2022-10-20-19-07-42-632.png,
> image-2022-10-20-19-08-23-932.png, screenshot-1.png, screenshot-2.png,
> screenshot-3.png, screenshot-4.png, 引起宕机-1.pdf, 引起宕机.pdf
>
>
> code(only this part of the code):
> PDDocument load = PDDocument.load(file,
> MemoryUsageSetting.setupTempFileOnly(-1);
>
> hi. Why do I configure it like this, it still takes up so much memory? What
> is the effect of using setupTempFileOnly.
> !image-2022-10-20-14-30-19-790.png!
> !image-2022-10-20-14-30-57-332.png!
> !image-2022-10-20-14-32-10-258.png!
> [^引起宕机.pdf]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]