JDK-8035938 : Memory leak in JvmtiEnv::GetConstantPool
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 7u7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2014-02-24
  • Updated: 2015-09-29
  • Resolved: 2015-01-17
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 7 JDK 8 JDK 9
7u80Fixed 8u51Fixed 9 b49Fixed
Description
FULL PRODUCT VERSION :
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)


FULL OS VERSION :
Linux 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
A lot of calls to Jvmti::GetConstantPool result in a high memory consumption.
This is caused by the JvmtiConstantPoolReconstituter, which instantiates two SymbolHashMap in it's constructor and in it's destructor os::free is used instead of delete.
The memory leak occurs in the native heap.


THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use a jvmti agent implementation calling Jvmti::GetConstantPool of some class (e.g. java.lang.String) in a loop.

EXPECTED VERSUS ACTUAL BEHAVIOR :
exptected: heap usage of the jvm remaining constant
actual result: heap usage of the jvm growing very fast
REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
no workaround


Comments
SQE OK to take the fix in 8u51
22-04-2015

The PSU15_03-critical-request is only for JDK 8, the fix is already out in JDK 7
09-04-2015

SQE OK to take the low ris fix to PSU15_02. Nightly results for the binaries with the fix are OK.
23-01-2015

We don't have a reproducer, but the problem is specific enough for us to look into anyway
27-02-2014