Possible FileHandle leak in BenchmarkGenerator
Alex Blewitt
alex.blewitt at gmail.com
Tue May 3 13:26:19 UTC 2016
> On 3 May 2016, at 12:59, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
>
>> On 05/03/2016 02:13 PM, Alex Blewitt wrote:
>> I tested the fix - it's necessary but not sufficient as there is a
>> similar file leak for the same named file in the Reader in the
>> complete method above as well. Once I patched that in a similar way
>> using a try/finally and the safe close from FileUtils it worked.
>
> Thanks!
>
> Like this?
> http://cr.openjdk.java.net/~shade/7901666/poc-v2.patch
My implementation was slightly different but only through code style rather than anything important. I've tested the v2 patch and it works as expected.
If you're making changes to the FileUtils you might want to add a close safe method for Closeable - there's a leak of a URLClassloader in ClassUtils::loadClass - but that's a separate issue and unrelated to the benchmark list. Of course since both reader and writer are Closesables you might get away with one method (or two to preserve backward compatibility with the prior version)
Alex
More information about the jmh-dev
mailing list