From: DRC Date: Mon, 17 Mar 2014 10:12:11 +0000 (+0000) Subject: Move the garbage collection of the JPEG tiles into the decompression function to... X-Git-Tag: 1.3.1~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88f260c78cd7291d85813ad9b28112cdf9359cf5;p=libjpeg-turbo Move the garbage collection of the JPEG tiles into the decompression function to increase the chances that tiled decompression of large images will succeed without an OutOfMemoryError. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1179 632fc199-4ca6-4c93-a231-07263d6284db --- diff --git a/java/TJBench.java b/java/TJBench.java index 8558699..9bee6ee 100644 --- a/java/TJBench.java +++ b/java/TJBench.java @@ -171,6 +171,9 @@ class TJBench { } tjd = null; + for (i = 0; i < jpegBuf.length; i++) + jpegBuf[i] = null; + jpegBuf = null; jpegSize = null; System.gc(); if (quiet != 0) @@ -401,11 +404,6 @@ class TJBench { decompTest(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual, fileName, tilew, tileh); - for (i = 0; i < ntilesw * ntilesh; i++) - jpegBuf[i] = null; - jpegBuf = null; jpegSize = null; - System.gc(); - if (tilew == w && tileh == h) break; } }