JDK-8306825 : Monitor deflation might be accidentally disabled by zero intervals
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17,20,21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-04-25
  • Updated: 2023-09-19
  • Resolved: 2023-05-01
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 20 JDK 21
17.0.10-oracleFixed 20.0.2Fixed 21 b21Fixed
Related Reports
Relates :  
Description
Found this mistake while backporting JDK-8305994: if we put GADI=0 (defined as "disable guaranteed deflation"), then the MonitorDeflationThread would call `wait(0)`, that is, wait indefinitely for the notify. This breaks triggering the threshold heuristics! 

But what is even more concerning, the same thing would happen even prior to JDK-8305994, if we put GuaranteedSafepointInterval=0 too. Which means users who kept GSI=0 as the way to dodge excess safepoints, now effectively disable monitor deflation.

Draft: https://github.com/openjdk/jdk/pull/13635
Comments
Fix Request (20u, 17u) This fixes deflation heuristics in face of odd user configuration. This would show up as the slow memory leak with "Object Monitors" NMT growing up. The patch applies cleanly to 20u and 17u. Testing, including new regression tests, passes. JDK-8305994, JDK-8306774, JDK-8306825 all go in together to fix related issues at once.
02-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1318 Date: 2023-05-02 10:53:05 +0000
02-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20u/pull/71 Date: 2023-05-02 09:09:15 +0000
02-05-2023

Changeset: a6b4f25b Author: Aleksey Shipilev <shade@openjdk.org> Date: 2023-05-01 07:56:07 +0000 URL: https://git.openjdk.org/jdk/commit/a6b4f25bd50e6861281d162f143c5bc9c16bac51
01-05-2023

Mach5 testing of v01: Mach5 Tier1: - no failures Mach5 Repeat-50 of runtime/Monitor/DeflationIntervalsTest.java: - linux-aarch64, linux-x64, macosx-aarch64, macosx-x64, windows-x64 - 50 iterations of all 11 sub-tests passed on all 5 platforms
27-04-2023

Mach5 testing: Mach5 Tier1: - no failures Mach5 Repeat-50 of runtime/Monitor/DeflationIntervalsTest.java: - linux-aarch64, linux-x64, macosx-aarch64, macosx-x64, windows-x64 - 50 iterations of all 11 sub-tests passed on all 5 platforms
27-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13635 Date: 2023-04-25 09:55:10 +0000
26-04-2023