From: Jeremias Maerki Date: Thu, 25 Aug 2005 14:26:28 +0000 (+0000) Subject: After chasing a phantom for hours, it looks like it's simply the big images being... X-Git-Tag: fop-0_90-alpha1~343 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=73aef5739f02e0d4fcaebe2d0b2d99d81bbb332a;p=xmlgraphics-fop.git After chasing a phantom for hours, it looks like it's simply the big images being generated that eat over 90% of the memory and at some point cause an OutOfMemoryError. Releasing the bitmaps a little sooner now which helps a little. "-Xmx256m" is still a good idea for BatchDiffer. Haven't found any memory leaks inside FOP, since I fixed the image cache. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@240079 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/java/org/apache/fop/visual/BatchDiffer.java b/test/java/org/apache/fop/visual/BatchDiffer.java index d270e6411..141dedd44 100644 --- a/test/java/org/apache/fop/visual/BatchDiffer.java +++ b/test/java/org/apache/fop/visual/BatchDiffer.java @@ -201,7 +201,9 @@ public class BatchDiffer { BufferedImage diff = BitmapComparator.buildDiffImage(bitmaps[0], bitmaps[k]); outputFile = new File(targetDir, f.getName() + "._diff" + k + ".png"); saveAsPNG(diff, outputFile); + bitmaps[k] = null; } + bitmaps[0] = null; maxfiles = (maxfiles < 0 ? maxfiles : maxfiles - 1); if (maxfiles == 0) { break; @@ -252,7 +254,10 @@ public class BatchDiffer { Thread.currentThread().setPriority(Thread.MIN_PRIORITY); BatchDiffer differ = new BatchDiffer(); differ.runBatch(cfgFile); + + System.out.println("Regular exit..."); } catch (Exception e) { + System.out.println("Exception caugth..."); e.printStackTrace(); } }