Output Description
After the msLeaks tool analyzes the memory, it outputs files as listed in Table 1.
Output File Name |
Description |
|---|---|
leaks_dump_{timestamp}.csv |
When the memory analysis function in a step is used, the memory information result file is generated and saved in the leaksDumpResults/dump directory by default. For details, see leaks_dump_{timestamp}.csv File Description. |
{device}_trace_{timestamp}.json |
When the memory analysis function in a step is used, the visualization memory information result file is generated and saved in the leaksDumpResults/trace directory by default. For details, see {device}_trace_{timestamp}.json File Description. NOTE:
In the next version of MindStudio, the .json file will not be saved to the path, and the results will be printed to the screen. |
memory_compare_{timestamp}.csv |
When the memory comparison function is used, the memory comparison result file is generated, recording the baseline, comparison, and differences after comparison. The output file is saved in the leaksDumpResults/compare directory by default. For details, see memory_compare_{timestamp}.csv File Description. |
leaks_dump_{timestamp}.db |
The memory information result file in .db format can be displayed using MindStudio Insight. For details about the display result and operations, see "Memory Tuning" in MindStudio Insight User Guide. |
python_trace_{TID}_{timestamp}.csv |
The collection result file using Python Trace is saved in leaksDumpResults/dump by default. For details, see python_trace_{TID}_{timestamp}.csv File Description. |
leaks_dump_{timestamp}.csv File Description
Field |
Description |
|---|---|
ID |
Event ID. |
Event |
Event types recorded by msLeaks, including:
|
Event Type |
Event subtypes.
|
Name |
The value of Name depends on the value of Event. When the value of Event is any of the following, the value of Name has different meanings. If the value of Event is not one of the preceding values, the value of Name is N/A.
|
Timestamp(ns) |
Time when an event occurs. |
Process ID |
Process information. |
Thread ID |
Thread information. |
Device ID |
Device information. |
Ptr |
Memory address, which can be used as the ID of a memory block. The lifecycle of a memory block is from malloc of the same ptr to the next free. |
Attr |
Event-specific attributes. Each event type has its own attribute. The specific display information is as follows:
|
Call Stack(Python) |
(Optional) Python call stack information. |
Call Stack(C) |
(Optional) C call stack information. |
{device}_trace_{timestamp}.json File Description
The memory visualization output consists of two types of .json files, including cpu_trace_{timestamp}.json (visualization file on the host) and npu{id}_trace_{timestamp}.json (visualization file on the device), where id indicates the device ID, for example, npu0_trace_{timestamp}.json.
Files can be displayed by using visualization tools, such as Chrome trace (chrome://tracing/) or Perfetto (Perfetto UI), as shown in Figure 1.

File |
Name |
Description |
|---|---|---|
cpu_trace_{timestamp}.json (visualization file on the host) |
Process PID |
Kernel launch instrumentation information. PID in the name indicates the process ID. |
memory size |
CPU memory information. This parameter is collected only when the memory collection function on the host is enabled. |
|
pin memory size |
Host pinned memory allocated on the hal layer. |
|
npu{id}_trace_{timestamp}.json (visualization file on the device) |
Process PID |
Kernel launch instrumentation information. PID in the name indicates the process ID. |
{Framework Name} allocated memory size |
Allocated information of the memory pool of the corresponding framework. |
|
{Framework Name} reserved memory size |
Reserved information of the memory pool of the corresponding framework. |
|
Thread TID |
Duration of each step. TID in the name indicates the thread ID. |
|
mstx 0 |
mstx instrumentation information. |
|
Thread 0 |
Information of memory between steps that is not deallocated for a long time. |
memory_compare_{timestamp}.csv File Description
Table 4 describes the result file fields of the memory comparison.
Field |
Description |
|---|---|
Event |
The comparison event type recorded by msLeaks. The value can be OP_LAUNCH or KERNEL_LAUNCH. |
Name |
Kernel name. |
Device ID |
Device type and card number. |
Base |
Data in the first input file path. |
Compare |
Data in the second input file path. |
Allocated Memory(byte) |
Memory changes before and after the kernel call. If the value is N/A, the kernel is not called. |
Diff Memory(byte) |
Relative memory changes of Base and Compare.
|
python_trace_{TID}_{timestamp}.csv File Description
Field |
Description |
|---|---|
FuncInfo |
Function name. |
StartTime(ns) |
Start timestamp, which is the same as the event timestamp in the leaks_dump_{timestamp}.csv file. |
EndTime(ns) |
End timestamp. |
Thread ID |
Thread information. |
Process ID |
Process information. |
