JDK-6966194 : java heap memory not released when vm exits
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 1.2.2
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2010-07-02
  • Updated: 2019-02-11
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.
Related Reports
Relates :  
Relates :  
When the JVM exits, the memory used for the java heap is not released back to the O/S.  For applications launched from the command line with 'java' this is not a problem because the O/S reclaims all resources used by the process after it terminates.  However, applications that use the JNI invocation api to start the JVM and that continue to run after the JVM exits will see that the java heap memory (which can be very large) has been leaked.

Turning this in to an enhancement. I think this should be part of a larger effort to make sure that HotSpot exists cleanly and releases the memory it has allocated. The heap is just one part (admittedly a large part) of the memory that we don't release.

EVALUATION A long-standing problem that has never been reported, presumably because very few apps use the jni invocation api and run for any length of time after destroying the JVM. Nevertheless it would be nice for the JVM to do the proper housekeeping and clean up after itself.