When doing some memory leak hunting on a Compact Framework 2.0 application my team has developed, I decided to use some of the stuff that I learned at MEDC last month. Specifically using the Remote Performance Monitor tool (RPM) that was shipped with CF2.0 SP1. I'm not going to explain how to use RPM as there is a pretty good explanation of it here, however there was one gotcha I discovered when trying to profile our app on the Symbol MC70.
The issue comes down to the security configuration of the device that you are trying to profile on. Typically operator-supplied devices will be locked down to a certain degree, preventing what you can and can't do on them. However devices supplied from vendors such as Symbol, Intermec or TDS typically are not locked down, letting the developers do what they want with them.
The issue I encountered was when following Steve Pratscher's instructions to get RPM running, one of the steps for WM5 devices is to use the rapiconfig utility to provision the appropriate security settings. However when executing 'rapiconfig /p rpmprov.xml' as per his instructions all I ever got was:
Config failed (0x80070005): Access is denied.
Some googling determined that the reason for this is the security policy of the device was preventing rapiconfig from functioning. The way to fix this is to enable RAPI by manually editing the policy in the device registry (thanks Stuart Preston).
To do this, cradle and ActiveSync the device, use RemoteRegEdit edit the following values:
HKLM\Security\Policies\Policies\ Values\00001001 = 1 (decimal)
HKLM\Security\Policies\Policies\ Values\00001005 = 40(decimal)
And do a soft-reset.
At this point I was able to provision the rpmprov file using rapiconfig, use RPM to start up and profile my app, find the memory leak, boost the performance of my app, and then eventually showered in praise and gifts from the users.
Warning: Results may vary
:-)