RFR: JDK-8280002: jmap -histo may leak stream [v2]
Serguei Spitsyn
sspitsyn at openjdk.java.net
Fri Jan 14 18:10:29 UTC 2022
On Fri, 14 Jan 2022 16:25:09 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Very trivial fix to a handle/memory leak.
>>
>> JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd GC.class_histogram`. When called with an explicit file and an invalid argument for number of threads, it leaks the file (bit of memory and a handle).
>>
>> Reproduce with:
>>
>> `jmap -histo:parallel=notanumber,file=xx.txt`
>>
>> Can only be reproduced with jmap. jcmd is safe, arguments are handled correctly in shared code.
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>
> fix copyright
Hi Thomas,
Nice catch.
Looks good to me.
Thanks,
Serguei
-------------
Marked as reviewed by sspitsyn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7078
More information about the serviceability-dev
mailing list