Java: Avoid OOM error when running 'make test'

We need to garbage collect between iterations of the outside loop in
bufSizeTest() in order to avoid exhausting the heap when running with
Java 6 (which is still used on Linux to test the 32-bit version of
libjpeg-turbo in automated builds.)
This commit is contained in:
DRC
2016-02-09 01:35:39 -06:00
parent 8632f1b262
commit d123c125c5

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011-2015 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2016 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -892,6 +892,9 @@ public class TJUnitTest {
else
tjc.compress(dstBuf, 0);
}
dstImage = null;
dstBuf = null;
System.gc();
}
}
System.out.println("Done. ");