Code for memory usage statistics