JDK-8340824 : C2: Memory for TypeInterfaces not reclaimed by hashcons()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,23,24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-09-24
  • Updated: 2024-11-05
  • Resolved: 2024-10-02
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 21 JDK 23 JDK 24
21.0.7-oracleFixed 23.0.2Fixed 24 b18Fixed
Related Reports
Duplicate :  
Relates :  
Description
The list of interfaces for a TypeInterfaces is contained in a GrowableArray that's allocated in the type arena. When hashcons() deletes a TypeInterfaces object because an identical one exists, it can't reclaim memory for the object because it can only free the last thing that was allocated and that's the backing store for the GrowableArray, not the TypeInterfaces object.
Comments
OpenJDK 21 maintainer info: Note that JDK-8309203 got backported to OpenJDK 21.0.3 which introduced a memory leak regression that a backport to OpenJDK 21 of this bug fixes. See JDK-8343322 for the report.
05-11-2024

Added jdk21u-defer-next as this should get integrated once development for 21.0.7 opens.
05-11-2024

Fix request (21u): I'd like to backport this to 21u. An issue that was reported with tomcat: https://github.com/adoptium/adoptium-support/issues/1190 appears to be solved by this. It was also backported by Oracle before this issue showed up. Fix applies cleanly. I ran hotspot/compiler tests. Fix only affects how memory is allocated for some objects used by C2 (so their memory can be properly reclaimed).
04-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1122 Date: 2024-11-04 13:47:36 +0000
04-11-2024

[jdk23u-fix-request] Approval Request from Yagmur Eren Clean backport to fix memory reclamation issue for TypeInterfaces object by hashcons().
18-10-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk23u/pull/197 Date: 2024-10-18 13:02:24 +0000
18-10-2024

Changeset: 90c944fe Branch: master Author: Roland Westrelin <roland@openjdk.org> Date: 2024-10-02 07:11:10 +0000 URL: https://git.openjdk.org/jdk/commit/90c944fefe4a7827c08a8e6a81f137c3157a749b
02-10-2024

ILW = Memory leak with GrowableArray, medium?, no workaround = MMH = P3
25-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21163 Date: 2024-09-24 15:53:06 +0000
24-09-2024