From 80a3e249593369d9f35df8d8bb218083cdc16ef7 Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Tue, 10 Nov 2015 14:09:25 +0000 Subject: [PATCH] FOP-2538: PDF to PDF OOM git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1713641 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/FOUserAgent.java | 5 +++++ src/java/org/apache/fop/apps/FopFactory.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java index dca7def7b..9e317f9a3 100644 --- a/src/java/org/apache/fop/apps/FOUserAgent.java +++ b/src/java/org/apache/fop/apps/FOUserAgent.java @@ -39,6 +39,7 @@ import org.apache.xmlgraphics.image.loader.ImageContext; import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext; +import org.apache.xmlgraphics.image.loader.util.SoftMapCache; import org.apache.xmlgraphics.util.UnitConv; import org.apache.fop.Version; @@ -804,4 +805,8 @@ public class FOUserAgent { public Map getHyphenationPatternNames() { return factory.getHyphenationPatternNames(); } + + public SoftMapCache getPDFObjectCache() { + return factory.getPDFObjectCache(); + } } diff --git a/src/java/org/apache/fop/apps/FopFactory.java b/src/java/org/apache/fop/apps/FopFactory.java index d9c9708eb..50211d3bc 100644 --- a/src/java/org/apache/fop/apps/FopFactory.java +++ b/src/java/org/apache/fop/apps/FopFactory.java @@ -37,6 +37,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.xmlgraphics.image.loader.ImageContext; import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver; +import org.apache.xmlgraphics.image.loader.util.SoftMapCache; import org.apache.xmlgraphics.util.UnitConv; import org.apache.fop.apps.io.InternalResourceResolver; @@ -82,6 +83,8 @@ public final class FopFactory implements ImageContext { private final ColorSpaceCache colorSpaceCache; + private final SoftMapCache pdfObjectCache = new SoftMapCache(true); + private final FopFactoryConfig config; private final InternalResourceResolver resolver; @@ -433,4 +436,8 @@ public final class FopFactory implements ImageContext { public ColorSpaceCache getColorSpaceCache() { return this.colorSpaceCache; } + + public SoftMapCache getPDFObjectCache() { + return pdfObjectCache; + } } -- 2.39.5