pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-3284) Big Pdf parsing to text - Out of memory
Date Mon, 19 Aug 2019 16:57:00 GMT

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

ASF subversion and git services commented on PDFBOX-3284:
---------------------------------------------------------

Commit 1865489 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1865489 ]

PDFBOX-3284: remove commented code and debug stuff, no longer needed

> Big Pdf parsing to text - Out of memory
> ---------------------------------------
>
>                 Key: PDFBOX-3284
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3284
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 1.8.10, 1.8.11, 2.0.0, 3.0.0 PDFBox
>            Reporter: Nicolas Daniels
>            Priority: Major
>             Fix For: 3.0.0 PDFBox
>
>         Attachments: massparse-stat.txt
>
>
> I'm trying to parse a quite big PDF (26MB) and transform it to text, however I'm facing
a huge memory consumption leading to out of memory error. Running my test with -Xmx768M will
always fail. I've to increase to 1500M to make it work. 
> The resulting text is only 3MB so I don't understand why it is taking so much memory.
> I've tested this code over 1.8.10, 1.8.11 & 2.0.0 with same result.
> The pdf can be found [here|https://www2.swift.com/uhbonline/books/public/en_uk/clr_3_0_stdsmx_msg_def_rpt_sch/sr2015_mx_clearing_3dot0_mdr2_solution.pdf]
> My code:
> {code:title=Test.java|borderStyle=solid}
> @Test
> public void testParsePdf_Content_Memory() throws Exception {
> {
>     InputStream inputStream = new FileInputStream("c:/tmp/sr2015_mx_clearing_3dot0_mdr2_solution.pdf");
>     try {
>              StringWriter writer = new StringWriter();
> 	     FileWriter fileWriter = new FileWriter(new File("c:/tmp/test.txt"));
>              PDFTextStripper pdfTextStripper = new PDFTextStripper();
> 	     pdfTextStripper.writeText(PDDocument.load(inputStream), fileWriter);
>              fileWriter.close();
>     } finally {
>         inputStream.close();
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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


Mime
View raw message