Could anyone share suggestions or ways to check memory in the Xamarin.Android platform using Xamarin Studio?
I have tried with the below option available in Xamarin Studio,
Tools > Instruments > Allocations
But in that, I can select only iOS devices in the options as in below image,
Is there any solution for this?
Sadly, but you can't do it from Xamarin Studio in any reliable way. You can try profiler, but it requires Enterprise license. My suggestion is to use standard Android tools.
PREPARATION:
1) Download "Eclipse Memory Analyzer"
2) Find Android Device Monitor. Bundled with Android SDK and can be found at "Android-SKD/tools/monitor". You can find out location of that folder by opening Xamarin, pressing CMD + , and selecting SDK Locations.
3) Find Heap Snapshot converter (from Android to Java). Bundled with Android SDK and can be found at "Android-SDK/platform-tools/hprof-conv"
CAPTURE:
1) Install application with debug mode on device
2) Connect device to PC and launch monitor (2 step at preparation)
3) Launch the application and find it by application ID in devices.
4) Press Update Heap (icon to the right from bug icon)
5) Do stuff that you think makes leaks
6) Press Save Heap (icon to the right of start) and save it to the drive
RETRIEVER RESULTS:
1) Convert android Heap to Java Heap
1.1) Launch terminal
1.2) Locate Heap Shanpshot converter (hprof-conv) (3 step at preparation)
1.3) drop hprof-conv to terminal
1.4) drop Android heap, and then, drop it next and rename it. It will create correct copy in the same location with chosen name
android-sdk-macosx/platform-tools/hprof-conv raw.hprof converted.hprof
2) Open Eclipse Memory Analyzer (1 step at preparation)
3) Import acquired Head Dump
3) Select Leak Suspects Report
4) View results
You can try Xamarin Profiler https://www.xamarin.com/profiler
In Memory snapshots, you will see if there is the memory leak. But from my experience, if you get out of memory exception, may cause by you use large size image in your Android project.