Added memory tracking using iprofiler and valgrind.