0

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.

1 Answer 1

1

class_getInstanceSize() can give you instance size of your objects. You can write macros around your code to get the total size required by them, but it's a good start.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.