JDK-8280002 : jmap -histo may leak stream
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 16,17,18,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-14
  • Updated: 2022-12-12
  • Resolved: 2022-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 19
17.0.3Fixed 19 b06Fixed
Related Reports
Relates :  
Description
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).

Example:

jmap -histo:parallel=notanumber,file=xx.txt

Can only be reproduced with jmap. jcmd is safe, since `GC.class_histogram` handles argument for the `-parallel` option in shared code, and there it is done correclty.

Comments
Fix Request (jdk17): Important to fix to prevent the leak. Fix applies cleanly. Fix is very simple and carries low risk.
17-01-2022

Note: not an issue for 11 even though JDK-8215624 had been downported to 11u.
17-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/99 Date: 2022-01-17 08:25:29 +0000
17-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/768 Date: 2022-01-17 08:25:48 +0000
17-01-2022

Changeset: c359c358 Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2022-01-14 19:40:10 +0000 URL: https://git.openjdk.java.net/jdk/commit/c359c358c8ebaf7b1dddbc4b499a7aae65ba6736
14-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7078 Date: 2022-01-14 10:04:53 +0000
14-01-2022