I am developing an app that is crashing due to an excess of memory usage. I would like to know the amount of memory that is being used by each active thread so that I can decide which allocated or drawn in screen elements release or remove from view. Is there a way to obtain it?
I have tried using mach.h library but with mach_task_self() I can only access the memory used by the whole application.
Thanks in advance
You can’t because threads share the heap. Threads are created with a 512KB stack space, with memory pages allocated as needed. Other than that, there is no memory per thread value stored anywhere.