*/
private MemoryObserver() {
MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
NotificationEmitter emitter = (NotificationEmitter) mbean;
listener = new MemoryNotificationListener();
emitter.addNotificationListener(listener, null, null);
List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
// activate threshhold for all those of interest
for (MemoryPoolMXBean pool : pools) {
// if (pool.getType() == MemoryType.HEAP) {
if (pool.isCollectionUsageThresholdSupported()) {