Adding memory usage statistics to debug