This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Monitor Execution Time and Memory Usage in LabVIEW VIs

Updated Sep 22, 2023

Reported In

Software

  • LabVIEW

Issue Details

LabVIEW freezes after it has been running my program for a while. How can I know if this is related to a memory problem?
I would like to see how long it takes my VI to run and how much memory is used in my application.

Solution

LabVIEW has a built-in tool called the VI Profiler that provides information on timing and memory for your VIs. The procedure for using this tool is as follows:
  1. Stop any VIs that are currently running.
  2. Open the Show Buffer Allocations window by selecting Tools>>Profile>>Show Buffer Allocations and select the items of your VI for which you want to monitor the allocations.
  1. Open the Profile Performance and Memory window by selecting Tools>>Profile>>Performance and Memory.
  2. Place check marks in the boxes that you'd like to monitor and click the Start button to collect information.
  3. Run the VI you want to profile. You can return to the Profile window at any time and click the Snapshot button to take a cumulative snapshot of timing statistics.
  1. Stop your VI. After clicking the Snapshot button again, you will see timing information for all Vis including the main VI.
  1. Click on any column heading to sort by that column.
  2. Click the Stop button to end the profile session.

Additional Information

  • Collecting information about VI memory usage requires overhead which can create misleading timing statistics. For the most accurate timing information, do not collect timing and memory details simultaneously.
  • Taking a snapshot does not affect the final timing statistics, however, your main VI will report timing information equal to 0 until your application is done running.
  • Timing of VIs do not necessarily correspond to the amount of elapsed time that it takes for a VI to complete. This is because a multithreaded execution system can interleave the execution of two or more VIs. Also, there is a certain amount of overhead not attributed to any VI, such as the amount of time taken by a user to respond to a dialog box, or time spent in a Wait function on a block diagram, or time spent to check for mouse clicks.
  • To access the Profile Performance and Memory Window using LabVIEW 7.1 or earlier, navigate to Tools»Advanced»Profile VIs.