StepOne Webinar

.NET CF RPM - Who is Using My Controls

author: John Huffman

The primary use for Remote Performance Monitor is to find memory leaks and other kinds of objects that are growing a causing system problems. It is also very good for finding who is using a particular resource.

However another question is, which forms are actually using a particular control. In this case, we have a ClockControl that displays the current time on the form. The clock control is then updated on a regularly to display the current time. In theory, we should only need one clock ever displayed in our application, but by using RPM we see that there are actually three.  This is easily found by looking in the left panel of the GC Heap View.

RPM Display User of the Clock Control

But who is actually using the Clock Control? That is also easy to determine by looking at the right hand panel and finding the SNAP.UI.Controls.ClockControl object.  By expanding the object tree we can see the three separate memory objects and in the first line of each one is the form that is using the clock control.  In this case it’s PCKE.Forms.BrowserForm, SNAP.UI.Forms.MessageBox, and SNAP.UI.FormsKeyboardForm.

Also, we can see that each one of those is referenced by a SNAP.Util.UpdateTimer, which means each one is set up to receive Updates, even though they are not being displayed.  Now, we can start looking more closely to determine if the code should be updated.

Leave a comment

Your comment