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

David Pollak commented on PDFBOX-3082:
--------------------------------------

I don't think it's reasonable to call something "RC1" when you can't even make 
basic use of it on a Mac 10.11.x machine.

Lucky for me I have a Linux box and an OS X 10.10.x box to do development on, 
but maybe others are not so lucky.

Further, it took me nearly an hour to track down the underlying cause of the 
problem. It manifests itself as a "Could not initialize class 
org.apache.pdfbox.pdmodel.font.PDType1Font" issue rather than an out of memory 
issue because the class initialization failed and the JVM doesn't seem to 
propagate the underlying cause of the failure up.

So, please mark this as a show stopper and work on it ASAP.


> High memory consumption while building font cache
> -------------------------------------------------
>
>                 Key: PDFBOX-3082
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3082
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.0
>            Reporter: Maruan Sahyoun
>            Priority: Blocker
>             Fix For: 2.0.0
>
>         Attachments: heap-usage.png
>
>
> When the font cache is build there is a very high memory consumption.
> For this small program
> {code}
>     public static void main(String[] args)
>     {
>         PDFont font = PDType1Font.HELVETICA;
>         try
>         {
>             System.in.read();
>         }
>         catch (IOException e)
>         {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
>     }
> {code}
> I need to set {{-Xmx1512M}} in order to avoid an OOM
> Smaller memory settings will bring this
> {code}
> $ java -Xmx1256M -jar Test.jar 
> Nov 03, 2015 2:48:32 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider 
> loadCache
> WARNUNG: New fonts found, font cache will be re-built
> Nov 03, 2015 2:48:32 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider 
> <init>
> WARNUNG: Building font cache, this may take a while
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>       at org.apache.fontbox.cff.IndexData.initData(IndexData.java:95)
>       at org.apache.fontbox.cff.CFFParser.readIndexData(CFFParser.java:163)
>       at org.apache.fontbox.cff.CFFParser.parseFont(CFFParser.java:393)
>       at org.apache.fontbox.cff.CFFParser.parse(CFFParser.java:115)
>       at org.apache.fontbox.ttf.CFFTable.read(CFFTable.java:53)
>       at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:377)
>       at org.apache.fontbox.ttf.OpenTypeFont.getCFF(OpenTypeFont.java:61)
>       at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.addTrueTypeFontImpl(FileSystemFontProvider.java:432)
>       at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.addTrueTypeCollection(FileSystemFontProvider.java:344)
>       at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.scanFonts(FileSystemFontProvider.java:243)
>       at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.<init>(FileSystemFontProvider.java:224)
>       at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl$DefaultFontProvider.<clinit>(FontMapperImpl.java:132)
>       at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.getProvider(FontMapperImpl.java:151)
>       at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFont(FontMapperImpl.java:415)
>       at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFontBoxFont(FontMapperImpl.java:378)
>       at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.getFontBoxFont(FontMapperImpl.java:352)
>       at 
> org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:114)
>       at 
> org.apache.pdfbox.pdmodel.font.PDType1Font.<clinit>(PDType1Font.java:76)
>       at PDFontTest.main(PDFontTest.java:11)
> {code}
> Possible cause is a large number of fonts on my system
> {code}
> Nov 03, 2015 2:56:01 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider 
> loadCache
> WARNUNG: New fonts found, font cache will be re-built
> Nov 03, 2015 2:56:01 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider 
> <init>
> WARNUNG: Building font cache, this may take a while
> Nov 03, 2015 2:56:22 AM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider 
> saveCache
> WARNUNG: Finished building font cache, found 876 fonts
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to