Use the Resource Tracking window to detect memory leaks in a program.
![]() |
Note The Resource Tracking window and associated functions are available only in the LabWindows/CVI Full Development System. |
The Resources column of the Resource Tracking window displays both allocated and deallocated resources that you allocate in your program. LabWindows/CVI displays newly allocated resources in red text, existing allocated resources in black text, and recently released resources in grey text. The resources are also grouped in categories according to type; for example, memory, toolbox, user interface resources, and so on. Double-click a resource in the Resources column to go directly to the location in the source code where the resource was allocated. The Stack Trace section of the Resource Tracking window shows the call stack of functions when the resource was allocated, displaying the most recently called function at the top of the list and the initial function at the bottom of the list.
![]() |
Note RT On RT targets, leaked resources persist until you reboot the target. However, the Resource Tracking window displays only leaked resources from the most recent program execution. |
Resource tracking is available at both the extended and standard debugging levels. Selecting Extended in the Debugging Options section of the Build Options dialog box enables resource tracking by default. If you select Standard, you must use the SetEnableResourceTracking function to enable resource tracking.
To view the Resource Tracking window, select Window»Resource Tracking in the active LabWindows/CVI window. Right-clicking in the Resources column of the Resource Tracking window displays the context menu with the following options:
Right-clicking in the Stack Trace section of the Resource Tracking window displays the context menu with the following options:
Right-clicking on the tab of the Resource Tracking window displays the context menu with the following options:
Because tracking resources creates additional overhead, enabling resource tracking affects the performance of your program.