RFR [9]: 8173201: java/lang/reflect/PublicMethods/PublicMethodsTest.java fails because of too many open files
Paul Sandoz
paul.sandoz at oracle.com
Mon Jan 23 22:53:37 UTC 2017
+1
Paul.
> On 23 Jan 2017, at 14:29, Peter Levart <peter.levart at gmail.com> wrote:
>
> 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