List of usage examples for java.lang.management MemoryPoolMXBean setUsageThreshold
public void setUsageThreshold(long threshold);
From source file:org.toobsframework.management.MemoryMonitor.java
public static void setUsageThreshold(MemoryPoolMXBean memPool, double percentage) { MemoryUsage memUsage = memPool.getUsage(); long max = memUsage.getMax(); memPool.setUsageThreshold((long) (max * percentage)); }