How do I get the memory of my app as shown in Activity Monitor?
According to the docs MemoryUsed doesn’t show the memory fragmentation that Activity Monitor shows:
MemoryUsed As UInt64
Returns the total amount of memory used (in bytes) by the allocated objects.
More specifically, this returns the number of malloc'd bytes. Since the OS does not immediately give back memory after it is released there is no guarantee that this number will match OS values that you see in Activity Monitor, Task Manager or top.
top only shows a percentage. As far as I can see ps is similar to MemoryUsed. What else can I use?