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

liu commented on PDFBOX-5731:
-----------------------------

As long as COSName.getPDFName is called, a value will be recorded to 
org.apache.pdfbox.cos.COSName#nameMap, and there is no place in pdfbox to 
actively or release the useless values ​​in it.

This will cause the jvm to store some data that is irrelevant to the usage 
scenario.

Such as font-related keywords used in other scenarios.
 !screenshot-5.png! 

But these things are actually not what I need for my current PDF.

For example, the scenario of using pdf to convert images:
pdfA has a keyword COSName called COSName1. When we use pdfbox to convert pdfA 
into a picture, COSName.nameMap will permanently record COSName1.

When converting to pdfB, pdfB does not have COSName1. In fact, during the 
process of converting to pdfB, COSName1 is not needed at all. But there will 
still be COSName1 in the jvm, which is a memory leak.

> org.apache.pdfbox.cos.COSName#nameMap There is a memory leak problem.
> ---------------------------------------------------------------------
>
>                 Key: PDFBOX-5731
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5731
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.30, 3.0.1 PDFBox
>            Reporter: liu
>            Priority: Major
>         Attachments: image-2023-12-08-16-02-12-293.png, screenshot-1.png, 
> screenshot-2.png, screenshot-3.png, screenshot-4.png, screenshot-5.png
>
>
>  !image-2023-12-08-16-02-12-293.png! 
>  !screenshot-1.png! 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to