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.
This commit is contained in:
@@ -189,6 +189,9 @@ class TJBench {
|
||||
}
|
||||
|
||||
tjd = null;
|
||||
for (i = 0; i < jpegBuf.length; i++)
|
||||
jpegBuf[i] = null;
|
||||
jpegBuf = null; jpegSize = null;
|
||||
System.gc();
|
||||
|
||||
if (quiet != 0)
|
||||
@@ -430,11 +433,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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user