For C++ programs often appear memory leaks, cross-border access memory and memory does not match the release of error, we have analyzed existing memory error detection tools and methods, implemented in the Linux platform to run the memory testing tool MemDetect prototype based on the open source dynamic instrumentation-Valgrind using function family's memory information block management method and life cycle method. The prototype can detect memory leaks, cross-border access memory and memory does not match the release problems effectively, the validity and efficiency of the prototype are proved by comparing with Purify Rational.