How does Instruments access the memory allocation information in a running iOS app? I would like to write code that could monitor allocations created and destroyed by a class. Then, unit tests could be written to prevent memory leaks. Even if only a basic memory usage number is available, the unit test could read the number, create and destroy the target object, then read the number again and report problems.