fix memory test

@pwaller : you probably have the best idea of what this code was supposed to do, judging by `git blame`.