LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
cmteuffel

Highlight memory leaks in Desktop Execution Trace Toolkit

Status: New

If I get the sematic of trace memory allocations right, every "Memory Allocate" event for a given handle should be accompanied by a "Memory Free" event somewhen later for the same handle or there is a memory leak. Given that, the trace toolkit desperately needs a feature that highlights all "Memory Allocate" events where no free event exists. Moreover, the event details should not only contain the VI that allocated the memory but also the concrete diagram element. Optimal would be switching to Labview and highlighting the element in the diagram just like the "LabVIEW Compare" tool does.

For now I'm helping myself by

  • exporting the traces to text,
  • deleting everything except the handle in "Details" using regular expressions in ultra edit: ;^(?*^)^p
  • deleting all "Memory Resize" events for performance reasons: ^p^(?*^)Memory Resize^(?*^)^p
  • renaming the column name "#" with "ID"
  • importing the text file into an access database
  • executing an SQL statement that gives me the ID's of all open memory allocations:
SELECT jo.id
FROM (
  SELECT q1.id, c.Beginn 
  FROM queueTest2 AS q1 LEFT JOIN (
       SELECT q1.vi, q1.id AS Beginn, Min(q2.id) AS Ende
       FROM queueTest2 AS q1, queueTest2 AS q2
       WHERE q1.event='Memory Allocate' 
       And q2.event='Memory Free' 
       And q1.id<q2.id 
       And q1.Details=q2.Details
       GROUP BY q1.id, q1.vi) AS c 
  ON (q1.id=c.Beginn AND q1.Event='Memory Allocate'))  AS jo
WHERE isNull(jo.Beginn)

Please note that a Bug in MS Access 2007 reformats this statement on saving it in a way that executing it gives an join expression not supported error. This can be fixed by putting the ON statement into braces again (don't press save before executing).

1 Comment
Robert_Hoffman
Member

This is an older post, but I am now running into the same basic need.  In general, DETT gives too much information and not enough ways to highlight and flag entries, like Detailed Tracing in the real-time version.  Anybody else run into this?