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.