pynuttx: fix memleak

Only need to check used node, excluding free nodes.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang
2024-12-02 16:37:42 +08:00
committed by Alan C. Assis
parent ca92c208c1
commit b90638493a
+3 -1
View File
@@ -114,7 +114,9 @@ class MMLeak(gdb.Command):
sorted_addr = set()
t = time.time()
print("Gather memory nodes...", flush=True, end="")
for node in memdump.dump_nodes(heaps, {"no_pid": mm.PID_MM_MEMPOOL}):
for node in memdump.dump_nodes(
heaps, {"no_pid": mm.PID_MM_MEMPOOL, "used": True}
):
nodes_dict[node.address] = node
sorted_addr.add(node.address)