On Fri, 14 Jan 2022 10:04:53 GMT, Thomas Stuefe <stu...@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.

This pull request has now been integrated.

Changeset: c359c358
Author:    Thomas Stuefe <stu...@openjdk.org>
URL:       
https://git.openjdk.java.net/jdk/commit/c359c358c8ebaf7b1dddbc4b499a7aae65ba6736
Stats:     2 lines in 1 file changed: 1 ins; 0 del; 1 mod

8280002: jmap -histo may leak stream

Reviewed-by: shade, sspitsyn

-------------

PR: https://git.openjdk.java.net/jdk/pull/7078

Reply via email to