[OpenJDK 2D-Dev] [14] RFR JDK-8232634: [TEST_BUG] ICMColorDataTest runs for a long time

Alexey Ivanov alexey.ivanov at oracle.com
Mon Oct 21 19:11:01 UTC 2019


Hello,

Please review the fix for the test:

bug: https://bugs.openjdk.java.net/browse/JDK-8232634
webrev: http://cr.openjdk.java.net/~aivanov/8232634/webrev.00/


The test exhausts native memory so that a memory allocation fails. This 
situation is quite easy to achieve with 32 bit processes but it's 
somewhat impossible with 64 bit processes. With 64 bit JREs, the test 
could take a very long time to run: up to 80 minutes on Windows in the 
most extreme cases. It's a lot of time!

I was running this test in different configurations and found that the 
expected exception is thrown at 20-25 thousand iterations (32-bit). It 
usually takes 3-4 minutes.

If a Garbage Collector cycle is triggered, Java objects (BufferedImage) 
are disposed of, and native resources are freed. If it happens, the test 
will not throw the expected exceptions. When using 64-bit JRE, a GC is 
triggered after 65 thousand iterations, which takes about 30-40 minutes. 
I had to use SerialGC because the default G1 reclaims Java objects too 
fast, so that the error condition is never reached.

In the fix, I reduced the number of iterations to 30,000 which covers 
the case where the problem is reproducible. The execution time reduced 
to about 5 minutes. I set the new timeout for the test to 10 minutes 
(600 seconds) which should be enough even for slower hardware.

-- 
Regards,
Alexey


More information about the 2d-dev mailing list