JDK-8029070 : memory leak in jmm_SetVMGlobal
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: hs25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-11-24
  • Updated: 2015-01-21
  • Resolved: 2013-12-23
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 8 JDK 9
8u40Fixed 9 b02Fixed
Description
ILW=MLH=>P4

By contract of CommandLineFlags::ccstrAtPut, caller must free the old value of ccstr flag, but jmm_SetVMGlobal doesn't do it.
Comments
The jmm_*() stuff belongs to the Serviceability team. Moving this bug back to 'hotspot/svc'.
09-12-2013

I moved it to hsx::runtime, because I wasn't sure which team is resp. for jmm. If it's hsx::svc, please move it back.
07-12-2013

So why was this bug moved to hotspot/runtime from hotspot/svc?
07-12-2013

noreg-long(hard): time to get native oom depends on the size of virtual memory, required time can be decreased by setting limits (-v and -m on linux), but jtreg doesn't give such opportunity.
24-11-2013

suggested fix: --- a/src/share/vm/services/management.cpp +++ b/src/share/vm/services/management.cpp @@ -1841,6 +1841,9 @@ } ccstr svalue = java_lang_String::as_utf8_string(str); succeed = CommandLineFlags::ccstrAtPut(name, &svalue, Flag::MANAGEMENT); + if (succeed) { + FREE_C_HEAP_ARRAY(char, svalue, mtInternal); + } } assert(succeed, "Setting flag should succeed"); JVM_END
24-11-2013

jmmOOM can provoke OOM due to that leak
24-11-2013