RFR [9]: 8173201: java/lang/reflect/PublicMethods/PublicMethodsTest.java fails because of too many open files

Peter Levart peter.levart at gmail.com
Mon Jan 23 22:29:04 UTC 2017


Hi,

I have a fix for intermittently failing test that I created recently:

http://cr.openjdk.java.net/~plevart/jdk9-dev/8173201_PublicMethodsTest.fix/webrev.01/

The test has been found to fail with a strange compilation error:

     https://bugs.openjdk.java.net/browse/JDK-8173201

...which is just a consequence of javac (used via JavaCompiler API) not 
being able to open another file.

I have debuged the test with "lsof" Linux utility and saw the test 
opening several thousand files. It creates 1379 StandardJavaFileManager 
objects as delegates for custom ForwardingJavaFileManager objects 
encapsulating individual test case sources to be compiled. The test then 
uses those file manager objects but never closes them explicitly. The 
fix is to close those file manager objects as soon as they are not 
needed any more. After applying the fix, I re-checked with "lsof" 
utility to confirm that the test keeps just a few files open now.

Regards, Peter



More information about the core-libs-dev mailing list