OMemoryWatchDog.setPercentageUsageThreshold(iThreshold);
final MemoryMXBean memBean = ManagementFactory.getMemoryMXBean();
final NotificationEmitter memEmitter = (NotificationEmitter) memBean;
memEmitter.addNotificationListener(new NotificationListener() {
public synchronized void handleNotification(Notification n, Object hb) {
if (n.getType().equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
alertTimes++;
long maxMemory = tenuredGenPool.getUsage().getMax();
long usedMemory = tenuredGenPool.getUsage().getUsed();