From 433cee3a9d355cf1537774ebc19ab07418a019fb Mon Sep 17 00:00:00 2001 From: Ammar Shaikh <70856548+ammar1510@users.noreply.github.com> Date: Sat, 25 Jul 2026 02:47:45 +0530 Subject: [PATCH] leaks: add page (#22918) --- pages/osx/leaks.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/osx/leaks.md diff --git a/pages/osx/leaks.md b/pages/osx/leaks.md new file mode 100644 index 0000000000..0ea0fb9820 --- /dev/null +++ b/pages/osx/leaks.md @@ -0,0 +1,36 @@ +# leaks + +> Search a process's memory for unreferenced malloc buffers. +> More information: . + +- 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}}`