United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7066129 : GarbageCollectorMXBean#getLastGcInfo leaks native memory

Details
Type:
Bug
Submit Date:
2011-07-12
Status:
Closed
Updated Date:
2013-09-12
Project Name:
JDK
Resolved Date:
2012-03-24
Component:
hotspot
OS:
generic,linux
Sub-Component:
svc
CPU:
generic,x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u26,6u30
Fixed Versions:
hs23 (b12)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
Using the getLastGcInfo on the sun jdk extension causes a native memory leak. Running the following program, one can easily see the RES memory of the java process increasing. This is really problematic since this method seems to be used by many libraries out there...

import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.List;

public class TestMemoryLeak {

    public static void main(String[] args) throws Exception {
        while (true) {
            List<GarbageCollectorMXBean> gcMxBeans = ManagementFactory.getGarbageCollectorMXBeans();
            for (GarbageCollectorMXBean gcMxBean : gcMxBeans) {
                ((com.sun.management.GarbageCollectorMXBean) gcMxBean).getLastGcInfo();
            }
        }
    }
}


REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/bf864f701a4a
                                     
2012-03-22
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/bf864f701a4a
                                     
2012-01-27
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/bf864f701a4a
                                     
2012-01-25
EVALUATION

GCStatInfo structure in hotspot is allocated, but never freed.
                                     
2011-12-28



Hardware and Software, Engineered to Work Together