From dev-return-61177-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Sun Feb 3 12:49:04 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3B8E9180626 for ; Sun, 3 Feb 2019 13:49:04 +0100 (CET) Received: (qmail 25913 invoked by uid 500); 3 Feb 2019 12:49:03 -0000 Mailing-List: contact dev-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list dev@pdfbox.apache.org Received: (qmail 25902 invoked by uid 99); 3 Feb 2019 12:49:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2019 12:49:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id EAC8DC9914 for ; Sun, 3 Feb 2019 12:49:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Nv2bHNVq-FMc for ; Sun, 3 Feb 2019 12:49:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 29EF85F1E7 for ; Sun, 3 Feb 2019 12:49:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B31C2E26CF for ; Sun, 3 Feb 2019 12:49:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4096B243EE for ; Sun, 3 Feb 2019 12:49:00 +0000 (UTC) Date: Sun, 3 Feb 2019 12:49:00 +0000 (UTC) From: "Tilman Hausherr (JIRA)" To: dev@pdfbox.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (PDFBOX-4450) java.lang.OutOfMemoryError when validating pdf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PDFBOX-4450?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Tilman Hausherr resolved PDFBOX-4450. ------------------------------------- Resolution: Fixed Assignee: Tilman Hausherr Fix Version/s: 3.0.0 PDFBox 2.0.14 Snapshot available here (but I've read on SO that you solved the problem wi= th the size limit): https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pd= fbox-app/2.0.14-SNAPSHOT/ > java.lang.OutOfMemoryError when validating pdf=20 > ----------------------------------------------- > > Key: PDFBOX-4450 > URL: https://issues.apache.org/jira/browse/PDFBOX-4450 > Project: PDFBox > Issue Type: Bug > Components: Preflight > Affects Versions: 2.0.13 > Reporter: Dana Shaw > Assignee: Tilman Hausherr > Priority: Major > Fix For: 2.0.14, 3.0.0 PDFBox > > Attachments: lean-from-the-trenches-p136.pdf, lean-from-the-trenc= hes.pdf > > > Getting an out of memory exception when attempting to use preflight to va= lidate pdfs. > =C2=A0 > Env: > Linux 64 bit (arch linux) > Java 8 > java -version > java version "1.8.0_131" > Java(TM) SE Runtime Environment (build 1.8.0_131-b11) > Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) > JVM args used to test:=C2=A0 > java -Xmx2048m -Dsun.java2d.cmm=3Dsun.java2d.cmm.kcms.KcmsServiceProvider > =C2=A0 > PDF that is blowing up=C2=A0 > [^lean-from-the-trenches.pdf] > =C2=A0 > {code:java} > Console output > Jan 30, 2019 10:25:58 AM org.apache.pdfbox.pdmodel.font.PDType1Font > WARNING: Using fallback font ArialMT for base font Symbol > Jan 30, 2019 10:25:58 AM org.apache.pdfbox.pdmodel.font.PDType1Font > WARNING: Using fallback font ArialMT for base font ZapfDingbats > Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit = exceeded > at java.util.Arrays.copyOfRange(Arrays.java:3664) > at java.lang.String.(String.java:207) > at java.lang.StringBuilder.toString(StringBuilder.java:407) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1587) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1587) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1587) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1587) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1587) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.getDictionaryString(COSDictionary.= java:1559) > at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1531) > at org.apache.pdfbox.preflight.xobject.XObjFormValidator.checkGroup(XObjF= ormValidator.java:138) > at org.apache.pdfbox.preflight.xobject.XObjFormValidator.validate(XObjFor= mValidator.java:73) > at org.apache.pdfbox.preflight.process.reflect.GraphicObjectPageValidatio= nProcess.validate(GraphicObjectPageValidationProcess.java:74) > at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(Context= Helper.java:84) > at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(Contex= tHelper.java:57) > at org.apache.pdfbox.preflight.process.reflect.ResourcesValidationProcess= .validateXObjects(ResourcesValidationProcess.java:224) > at org.apache.pdfbox.preflight.process.reflect.ResourcesValidationProcess= .validate(ResourcesValidationProcess.java:81) > at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(Context= Helper.java:84){code} > =C2=A0 > Code used: > =C2=A0 > {code:java} > import java.io.File; > import java.util.ArrayList; > import java.util.List; > import org.apache.pdfbox.preflight.PreflightDocument; > import org.apache.pdfbox.preflight.ValidationResult; > import org.apache.pdfbox.preflight.ValidationResult.ValidationError; > import org.apache.pdfbox.preflight.parser.PreflightParser; > public class Validator { > private File file =3D null; > private List errorList =3D new ArrayList(); > public Validator(File file) { > this.file =3D file; > } > public List getErrors(){ > return errorList; > } > public boolean validate() throws Exception{ > PreflightParser parser =3D null; > PreflightDocument document =3D null; > ValidationResult result =3D null; > try { > parser =3D new PreflightParser(file); > parser.parse(); > document =3D parser.getPreflightDocument(); > document.validate(); > result =3D document.getResult(); > errorList =3D result.getErrorsList(); > } > catch(Exception e) { > throw e; > } > finally { > if(document !=3D null) { > try { > document.close(); > }catch(Exception ignored) {} > } > parser =3D null; > document =3D null; > result =3D null; > } > return errorList.size() > 0 ? true : false; > } > } > {code} > =C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org For additional commands, e-mail: dev-help@pdfbox.apache.org