List of usage examples for java.lang.management ManagementFactory getMemoryPoolMXBeans
public static List<MemoryPoolMXBean> getMemoryPoolMXBeans()
From source file:org.toobsframework.management.MemoryMonitor.java
private void init() { MemoryMXBean mem = ManagementFactory.getMemoryMXBean(); ((NotificationBroadcaster) mem).addNotificationListener(listener, null, null); for (MemoryPoolMXBean memPool : ManagementFactory.getMemoryPoolMXBeans()) { if (memPool.isUsageThresholdSupported()) { memPools.put(memPool.getName(), memPool); log.info("Putting Pool " + memPool.getName()); setUsageThreshold(memPool, 0.7); }/*from w w w . j av a 2 s .c o m*/ } }