Q:

How to get the current heap size that an android application is using?

I found that it can be easily done using java from this answer but couldn't find yet how to do it if my applicating is written using C#.NET and xamarin libraries. How to get those same datas (current heap size, maximum heap size) using this framework? 
Thanks in advance.

A:

I suppose you are looking for something like this:
long memory = GC.GetTotalMemory(true);

It retrieves the number of bytes currently thought to be allocated.
There is also another option:
Process currentProc = Process.GetCurrentProcess();
long memoryUsed = currentProc.PrivateMemorySize64;

You determine memory usage by reading the PrivateMemorySize64 property. You need using System.Diagnostics; reference to support this action.

