Windows Mobile: Memory leaks and monitoring performance Tool (RPM)
Tuesday, August 19th, 2008As most of you know, JAJAH released a pre-installed Windows Mobile VoIP client for the Japanese EMobile operator.
While working on it, I checked for performance issues and memory leaks. This was critical since in addition to outgoing VoIP calls the application runs in the background and listens to incoming VoIP calls. In order to monitor the performance I used the .Net compact framework remote performance Monitor (RPM). this tool is easy to use, once you understand how to install and use it, and this is the reason for this post.
Installation:
copy netcfrtl.dll and netcflaunch.exe from C:\ProgramFiles\Microsoft.NET\SDK\ CompactFramework\ v2.0\ WindowsCE\wce500\armv4i to the Windows directory on your device. (to copy from your desktop to your windows mobile device use ActiveSync)
Running the PRM:
Connect your device to the desktop using ActiveSync
Open NetCFRPM.exe from C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin
Select "File" and then "Live Counters"
In the device box select "ActiveSync" and in the "application" box enter your application you wish to test. Press "connect". the application will start and you will see the changing counters.
for more details about the counters check out David Kline’s post
Using this view you can see the counters change and see what’s going on. to make things easier to monitor, you can have a view of the heap at real time and compare the GC heap at different intervals.
GC Heap View:
Click "View GC Heap" to view the heap status. In this view you can see the number of instances each object has and the memory it consommes. you may also see the root object that is keeping the object alive, i.e. what is the object that holds a reference to the object and hence its not garbage collected.
Comparing heap states
Its very helpfully comparing different heap states over time. This can help you see the difference in object over time and help you find leaks in various states of your application. When interested to know the heap state click "View GC Heap". when you want to compare the heaps memory states go to "View" and then select "Compare Heap". this view allows you to view the difference in object during the run time.