Skip to content

Instantly share code, notes, and snippets.

Avatar

Siddarth Chandrasekaran siddarth

View GitHub Profile
@kimchy
kimchy / gist:1078717
Created Jul 12, 2011
native memory leak with GarbageCollectorMXBean#getLastGcInfo
View gist:1078717
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) {
You can’t perform that action at this time.