Memory Validator Tutorials

Memory Validator Tutorials

Using the Hotspot view.

Using Memory Validator with Visual Basic.

How to view GDI objects using Memory Validator.

How to use Memory Validator with a server application.

How to track memory allocations of a specific size using Memory Validator.

How to restrict the display to only a particular DLL using filters.

How to restrict the display to only a part of your application's execution.

How to prevent a DLL from loading.

How to monitor 3rd party memory allocation APIs using Memory Validator.

How to detect uninitialised data using Memory Validator.

How to detect memory leaks whilst your application is running.

How to detect memory leaks using Memory Validator.

How to detect memory corruption (tools) using Memory Validator.

How to detect memory corruption (memory reuse) using Memory Validator.

How to detect memory corruption (instrumentation) using Memory Validator.

How to detect memory corruption (instrumentation) using Memory Validator.

How to detect handle leaks using Memory Validator.

How to detect calling methods on deleted objects using Memory Validator.

How to detect broken message maps using Memory Validator.

How to detect COM Object Reference Count Errors using Memory Validator.

How to collect data only a from particular DLL.

Getting Started

Filtering using filename and line number.

Filtering using a filename.

Filtering using a directory name.

Filtering using a callstack.

Filtering using a DLL name.

Filtering by object type.

Filtering by handle type.

Filtering by allocation size.

Monitoring data from one or more DLLs

Miscellaneous

Memory Leak Detection

Memory Corruption and Application Crashes

Filters

Filter using allocation size

This tutorial assumes that you have read the memory leak tutorial about detecting memory leaks and that you have built the sample application. If you have not done this, please do so before continuing with this tutorial. 

 

This tutorial demonstrates how to prevent the display of data based on the size of the allocation and a comparison (equals, less than, greater than, range), by using a filter to control the data on the display. The filter can be inverted, thus converting the filter from “display anything not matching this filter” into “only display items matching this filter”.

  • Start your program using Memory Validator’s launch program option.Memory Validator launch toolbarThe launch application wizard displayed.

    Memory Validator launch wizard

    Select [installdir]\nativeExample\debugNonLink\nativeExample.exe using the Browse… button. Accept all default settings and move through all pages of the wizard to the last page. Click the Start Application button.

     

  • Use nativeExample.exe as normal.
  • Using Memory Validator, select the Memory tab and click Refresh. The display will show all allocations made by the application that have not been deallocated. The display will look similar to this:Memory Validator results selected by watermarks
  • Click on an entry with the right mouse button. A context menu will appear. Using the Local Filters popup select Custom Filter….Memory Validator Context menu custom filterThe custom filter dialog will be displayed.

    Memory Validator custom filter dialog

  • Select the Match Using Filter Type radio box.
    Using the Filter Type combo box, select Memory Allocation.
    Check the Match Using Object Type check box.
    Check the Match Using Object Size check box.
    Select the type of comparison in the Comparison type combo box.
    Type the size or size ranges as appropriate into the edit fields.
    The custom filter dialog should look similar to this image below:Memory Validator custom size filter dialog

    Click OK to accept the filter definition. The Memory tab display automatically updates.

     

  • As you can see, the display does not show any entries for objects matching the chosen size and comparison specification. You can create as many filters as you desire.
  • If you wish to change the filtering effect so that you see the data the filter selects and do not see the data the filter ignores, you can edit the filter and then check the Invert Filter check box at the bottom of the dialog. This option makes the filter display matches rather than hide matches.To edit the local filters.
    • Click on the Filter… button.
    • Double click on the filter in the list to display the filter definition dialog. Alternatively select the filter, then click the Edit… button.
    • Modify the filter and click OK or Cancel as appropriate.
    • Edit any other filters.
    • To see the effect of the filter, click Apply.
    • To accept the filters, click OK.
    • To discard the filter edits, click Cancel.

    To edit Global or Session filters you must use the Filter Manager, available from the toolbar or the Managers menu.

     

  • Local filters affect data displayed on their display tab.
  • Session filters affect data displayed for a particular session.
  • Global filters affect data in all sessions on all displays.

Fully functional, free for 30 days