Added somemore code to HeapMonitor