-
Enhancement
-
Resolution: Won't Fix
-
P3
-
None
-
generic
-
generic
There are some memory leaks issues caused by monitoring_management classes usage (JDK-7066129, JDK-7125594, JDK-7143760).
I think we could create tests that intensively using Platform MBeans, for example test case from CRJDK-7066129:
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();
}
}
}
}
If there are no leaks such test should not force resident memory growth. So we can simply check that it will not grow due some period of time (1 minute for example).
I think we could create tests that intensively using Platform MBeans, for example test case from CR
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();
}
}
}
}
If there are no leaks such test should not force resident memory growth. So we can simply check that it will not grow due some period of time (1 minute for example).