I'm trying to retrieve the amount of memory my iPhone app is using at anytime, programmatically. Yes I'm aware about ObjectAlloc/Leaks. I'm not interested in those, only to know if it's possible to write some code and get the amount of bytes being used and report it via NSLog.
Thanks.
Here's a Swift 3 Version:
Below is the correct answer:
```
```
The headers for
TASK_BASIC_INFO
say:Here is a version using
MACH_TASK_BASIC_INFO
:Swift 3.1 (As of August 8, 2017)
Here is report_memory() enhanced to rapidly show leak status in the NSLog().
Swift solution of Jason Coco's answer: