Bbx
Bbx

Reputation: 3384

Watching memory usage in MonoTouch App

How can I find out how much memory my App is using from inside the app itself, using MonoTouch?

I basically want this:

Watching memory usage in iOS

which calls things like "task_info"

but for MonoTouch (it's OK if works only on iOS). I don't want a memory tool, like Instruments, etc, I just want to know the memory used from inside the App itself, so I can display it and be able to check it isn't too much in various field trials, etc.

Upvotes: 1

Views: 653

Answers (1)

Rolf Bjarne Kvinge
Rolf Bjarne Kvinge

Reputation: 19335

I see at least two options:

  • Copy the "task_info" code into a new Xcode project and create a static library out of it. Then you link with that static library in your MonoTouch project, and use a P/Invoke to call logMemUsage.

  • Translate all the "task_info" code into C# (using P/Invokes to call native methods whenever required).

I would likely go for the first option, I believe it's somewhat less error prone.

Upvotes: 1

Related Questions