How to use valgrind to debug memory leaks. Install valgrind (jut type valgrind.sh). Compile the parallel code using -g -O0 as optoins (edit src/c/Makefile if necessary). Then set md.mem_debug=1, and run in parallel. Voila! The errlog will contain all the info spit out by valgrind.