Filter using directory

This tutorial assumes that you have read the tutorial on collecting memory leaks and that you have built the sample application. If you have no done this, please do do before continuing with this tutorial. The memory leak tutorial is here.

 

This tutorial demonstrates how to prevent the display of data allocated in a source file in a specific directory, 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 filter by file and line number
  • 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 Directory radio box.
    Using the combo box, select the directory name you want to filter. Selecting an empty directory will match any filenames that have no directory component.
    The custom filter dialog should look similar to this image below:Memory Validator custom filter for directory

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

    Memory Validator results filtered by directory

  • As you can see, the display does not show any entries for the directory name chosen. 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