Improvements to memory tracking