You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Patrick Stahle (JIRA)" <ji...@apache.org> on 2016/07/01 12:21:11 UTC

[jira] [Commented] (PDFBOX-3404) Threads using PDFBox getting stuck when using standard 14 fonts

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

Patrick Stahle commented on PDFBOX-3404:
----------------------------------------

Hi Tilman, It might take some time until we get actually test this. The only place we currently have a way to test this, is in production. We simply do not have anywhere close to the load on any other tier. I will talk to some other developers here to see if we can build some form a test case that can exercise this use case. Unfortunately one of the guys I need to talk to is on vacation until next week. I will keep you posted if we can come up with something.For putting 2.0.3 into production is probably at least a month away from that happening.

> Threads using PDFBox getting stuck when using standard 14 fonts
> ---------------------------------------------------------------
>
>                 Key: PDFBOX-3404
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3404
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.0, 2.0.2, 2.0.3, 2.1.0
>            Reporter: Tilman Hausherr
>             Fix For: 2.0.3, 2.1.0
>
>
> user [~prstahle] reports:
> {quote}
> We have a relatively heavily threaded application which is calling pdfbox to stamp certain
> pdf files. We have been in production for a little over a week and have run into a few threads
> getting stuck. The stack trace is the following:
> {quote}
> {code}
> ### Thread id=34, name="dispatch_2_20160626211454_1064"
> # ThreadInfo: "dispatch_2_20160626211454_1064" Id=34 RUNNABLE
> # CPU: threadCpuTime=49,541,548.824 ms, threadUserTime=49,538,533.066 ms
> # Contention: blockedCount=33 , blockedTime=123 ms
> # Contention: lockName=null , lockOwnerId=-1, lockOwnerName=null
> java.util.HashMap.put(HashMap.java:473)
> java.util.HashSet.add(HashSet.java:217)
> java.util.AbstractCollection.addAll(AbstractCollection.java:334)
> org.apache.pdfbox.pdmodel.font.encoding.Encoding.contains(Encoding.java:109)
> org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:343)
> org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:286)
> org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:315)
> com.tycoelectronics.emcs.stamppdf.StampEnginePDFBox.getLongestTextWidth(StampEnginePDFBox.java:1369)
> {code}
> {quote}
> We seem to be getting stuck in PDFont classes HashMap which is unsynchronized class.
> {quote}
> {quote}
> We are using  "PDType1Font.HELVETICA".
> {quote}
> The problem is that for the standard 14 fonts, each font is a singleton, but its code is being used multithreaded, so we have to secure that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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