]> granicus.if.org Git - libjpeg-turbo/commitdiff
Java: Avoid OOM error when running 'make test'
authorDRC <information@libjpeg-turbo.org>
Tue, 9 Feb 2016 07:35:39 +0000 (01:35 -0600)
committerDRC <information@libjpeg-turbo.org>
Tue, 9 Feb 2016 07:35:39 +0000 (01:35 -0600)
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.)

java/TJUnitTest.java

index d4726b3926e5fdd6434f5dfe8c7f4ca2c8968713..444e798530ac1634d8981cdebde989c7c3da1057 100644 (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.      ");