When a multithreaded program shares memory, problems can occur if one thread deallocated a memory block while another thread is still using it. Because threads execute intermittently, problems are also intermittent. If you hoard memory, the memory will stay viable for longer because it cannot be reused immediately.
One advantage of this technique is that you can relink your program (as is described in
Chapter 4, “Creating Programs for Memory Debugging”) and then run MemoryScape against a production program that was not compiled using the
–g compiler debugging option. If you see instances of the hoarded memory, you’ll instantly know problems have occurred.