leaks: add page (#22918)

This commit is contained in:
Ammar Shaikh
2026-07-24 23:17:45 +02:00
committed by GitHub
parent b9e0eaabb0
commit 433cee3a9d
+36
View File
@@ -0,0 +1,36 @@
# leaks
> Search a process's memory for unreferenced malloc buffers.
> More information: <https://keith.github.io/xcode-man-pages/leaks.1.html>.
- Examine a running process for leaks by its name:
`leaks {{process_name}}`
- Examine a running process for leaks by its PID:
`leaks {{pid}}`
- Launch a command and check for leaks when it exits:
`leaks -atExit -- {{command}}`
- Enable backtraces for each leak by setting the `MallocStackLogging` environment variable:
`MallocStackLogging=YES leaks {{process_name}}`
- Display results in the classic list format instead of a tree:
`leaks -list {{process_name}}`
- Group leaked objects by type:
`leaks -groupByType {{process_name}}`
- Save the memory state to a memory graph file for later analysis:
`leaks {{process_name}} -outputGraph {{path/to/file.memgraph}}`
- Examine a previously saved memory graph file:
`leaks {{path/to/file.memgraph}}`