Added some heap profiling code