The .Net Stale Object Detection tab allows you to specify how Memory Validator detects .Net objects that haven't been used recently.
Objects that haven't been used may be leaked objects.
Object activity data describes which objects have had methods called on them in a given timespan. Objects in use will get called often, whereas leaked objects will not get called at all.
There is a performance penalty for this monitoring. It can be quite expensive - how expensive depends on your application's behaviour.
•Collect object activity data monitor all calls to .Net objects.
The data is can be reported to the GUI with each garbage collection, or in real time. Real time provides more info, but is more expensive in terms of performance hit.
Once we have object activity data we can then interpret that data to provide stale object detection - detecting objects that haven't been called recently, where recently can be defined as a fraction of the application lifetime, or within the most recent N garbage detections.
There are four controls that influence which objects are identified as possibly stale. Depending upon your application behaviour and the settings you select you can make all objects appears stale or no objects appear stale, and many states between. How you set these values will affect what values you see in the Stale Objects subtab of the Ages view. The values are suggestions only, they are not guaranteed to be stale objects.
Before choosing your settings you need to be aware of a two things about garbage collected applications.
•Objects allocated early in the application lifetime often survive the entire application lifetime.
•Most objects do not survive many garbage collections.
Using these two facts and the knowledge of the application being monitored you can set the stale object detection settings. The settings come as two preconditions and two optional conditions (thresholds). The preconditions are described first.
Typically you don't want to perform stale object detection during the starting up your application - specify the number of startup garbage collections to ignore.
Set this value to the number of garbage collections that you notice happen during your application startup. You can see this by watching the Generations tab and counting the number of generations that are present once your application has started but before it has commenced any work.
GUI application: this would be the point at which the GUI had opened and the menu system was ready to accept commands.
Webserver: this would be the point at which the webserver was ready to accept connections from clients.
You may also want to ignore contemporary garbage collections - if so specify the number of recent garbage collections to ignore.
Set this value to the number of garbage collections that you think most objects will survive for. For example if you think most objects will be created, used, finalized in 3 garbage collections set this value to 3.
•Application lifetime threshold Consider objects that have not had activity for longer than the specified fraction of the application lifetime to be stale.
•Garbage collection threshold Consider objects that have no had activity for more garbage collections than specified to be stale.
Reset All - Resets all global settings, not just those on the current page.
Reset - Resets the settings on the current page.