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

Andreas Lehmkühler commented on PDFBOX-441:
-------------------------------------------

Ive made some of changes the changes mentioned before with version 758873. I've 
replaced the HashMap with a WeakHashMap and within the font-package I replace 
mostly all getPDFName-calls with a reference of a predefined static COSName 
constant.

Now we have to test, if this changes will get us a noticeable effect concerning 
the performance within a multithreaded environment. If there is such an effect, 
we have to look at the other 1.101 ...... So, I guess we will do it step by 
step, perhaps with a focus on the classes which are used more often than others.

I hope Sean and Chris are able to give us some feedback on this issue.   



> remove CosName nameMap cache
> ----------------------------
>
>                 Key: PDFBOX-441
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-441
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 0.7.3
>            Reporter: Sean Bridges
>            Priority: Minor
>
> The CosName class keeps a cache of all instances created in a static 
> synchronized map.  I am guessing this is for performance reasons to avoid 
> creating objects, but in our system it is causing performance problems.  We 
> are running 7 threads extracting text from pdf's, and we can see a large 
> number of conflicts reading from nameMap.
> The CosName map is also a potential memory leak, which forces users to 
> periodically clear it, as noted in PDFBOX-351
> Can nameMap be removed altogether?
> At the least, if PDSimpleFont replaced, 
>  COSName.getPDFName( "FontDescriptor" ) 
> with 
> COSName.FONT_DESC
> It would reduce contention.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to