From 9897edea00c46566f5cd077222131c3296291239 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Fri, 4 Nov 2016 13:33:16 +0100 Subject: prepare for memory resource managment --- .../main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/PDFBOXObject.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pdf-as-pdfbox-2/src/main/java') diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/PDFBOXObject.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/PDFBOXObject.java index e380e483..891ebe39 100644 --- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/PDFBOXObject.java +++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/PDFBOXObject.java @@ -6,6 +6,7 @@ import java.util.Map; import javax.activation.DataSource; +import org.apache.pdfbox.io.MemoryUsageSetting; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.font.PDFont; @@ -52,7 +53,12 @@ public class PDFBOXObject extends PDFObject { doc = null; } } - + + private MemoryUsageSetting getMemoryUsageSettings() { + // TODO: allow fine tuning of memory usage (divided main memory vs file memory) + return MemoryUsageSetting.setupMainMemoryOnly(); + } + public void setOriginalDocument(DataSource originalDocument) throws IOException { this.originalDocument = originalDocument; if(doc != null) { -- cgit v1.2.3