Memory Tuning
Importing Data
- Start MindStudio Insight and click Import Data in the navigation tree on the left.
- In the File Explorer dialog box that is displayed, select the .db file to be imported, as shown in Figure 1.
- After the import is successful, the Leaks page is displayed.
Analyzing Memory
- Open the Leaks page to view the Function Stack Flame Graph and Memory Request/Release Line Graph & Memory Block Graph. For details about the leaks page, see "Memory Tuning" in MindStudio Insight User Guide.
- Click and drag the mouse to select the step 2 area in the Memory Request/Release Line Graph & Memory Block Graph and release the mouse button to zoom in on the step 2 area.
As shown in Figure 2, when step 2 ends, there is still an unreleased memory block.
- In the Function Stack Flame Graph, the memory block is found to originate from a tensor object, which was allocated before the forward propagation starts, as shown in Figure 3.
- In the code block marked with leaks_mem, the Memory Details Disassembly Diagram reveals a significant increase. The memory usage under the leaks_mem label first appears at 40 MB in step 1, as shown in Figure 4.
Parent topic: Memory Leak Analysis





