feat: add --tracemalloc flag for memory profiling

Starts tracemalloc before the event loop and dumps the top 25
allocations on shutdown. Accepts optional nframes depth (default 10).
Can be combined with --cprofile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-17 10:41:45 +01:00
parent 933d9e1ddd
commit a123eba32a
2 changed files with 35 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ derp --config /path/to/derp.toml --verbose
| `-c, --config PATH` | Config file path |
| `-v, --verbose` | Debug logging |
| `--cprofile [PATH]` | Enable cProfile, dump to PATH [derp.prof] |
| `--tracemalloc [N]` | Enable tracemalloc, capture N frames deep [10] |
| `-V, --version` | Print version |
| `-h, --help` | Show help |