Skip to content

Instantly share code, notes, and snippets.

View siddarth's full-sized avatar

Siddarth Chandrasekaran siddarth

View GitHub Profile
@kimchy
kimchy / gist:1078717
Created July 12, 2011 19:09
native memory leak with GarbageCollectorMXBean#getLastGcInfo
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) {