David adds the source code of doing memory test.