A collection of snippets for memory leak simulation and diagnosis