Collect data from specific DLL

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 use Memory Validator to monitor activities in selected DLLs. The sample application, nativeExample.exe will be used. The selected DLLs to monitor will be the following DLLs:

  • dlladependentonb.dll
  • dllbdependentonc.dll
  • dllc.dll

All other dlls/exes will not be monitored.

  • If you are in Novice user interface mode, switch to Intermediate or Expert mode. Choose User Interface Mode on the Configure menu.Memory Validator settings menu, configure user interfaceThe user interface mode dialog will be displayed.

    Memory Validator user interface mode dialog

    Select Expert and click OK.

  • Open the settings dialog and select the Hooked DLLs tab.Memory Validator dlls to hook settings
  • Select the second radio box (Hook the enabled DLLs…) so that Memory Validator will only hook the DLLs we tell it to hook.
  • Remove all DLLs from the list (if there are any specified) by clicking the Remove All button.
  • Now we need to add the three DLLs we are interested in.Click Add.Module... The Microsoft File Selection Dialog is displayed. Browse to the location of the dll to add. In this case, you need to browse to [installdir]\nativeExample\debugNonLink\dlladependentonb.dll. Repeat this for each of the dlls.
    • dlladependentonb.dll
    • dllbdependentonc.dll
    • dllc.dll

    When each dll is added, it is automatically enabled. When you have finished adding your DLLs, the dialog will look something like:Memory Validator, three dlls to hook

  • Click OK to accept the changes.
  • 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.
  • Now load the dependent DLLs from the DLL menu, option Load dependent DLLs. This menu option causes the example application to load a DLL A that is dependent on DLL B that is dependent on DLL C. The act of loading DLL A causes DLL B and DLL C to load. Each DLL allocates an object defined in a different DLL.Context menu, Load dependent DLLs
  • 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 displaying results only for a specific DLL
  • As you can see, the display has been restricted to showing the data collected from the selected DLLs.When your test application exits, all memory statuses are updated. The picture below shows the example application data after the example application has exited.Memory Validator display memory leaks results for a specific DLL

Fully functional, free for 30 days