gitmyhub

bytehound

C ★ 4.8k updated 2y ago

A memory profiler for Linux.

A Linux memory profiler that records every memory allocation and release with full call stack traces, then lets you explore the results through a local web interface to pinpoint memory leaks and identify the exact code paths causing excessive memory use.

RustCLinuxjemallocAMD64ARMAArch64MIPS64setup: moderatecomplexity 4/5

Bytehound is a memory profiler for Linux. When a program runs, it constantly requests and releases blocks of memory to do its work. If it requests more than it releases, memory usage grows over time and the program can eventually crash or slow the whole machine down. Bytehound tracks every one of those requests and releases, records where in the code each one came from, and gives you tools to figure out what went wrong.

The tool records a full call stack for each allocation, meaning it can tell you not just that memory was used, but which function called which function called which function to get there. This level of detail makes it much easier to trace a memory problem to its source than tools that only show totals. Bytehound is also designed to be fast: it uses a custom approach to reading the call stack that the authors say can be orders of magnitude quicker than comparable tools, which matters when you want to profile a long-running application without slowing it down too much.

Once profiling is complete, you can view the results through a built-in web interface that runs locally in your browser. The interface shows memory usage over time, groups allocations by where they originated in the code, and includes a scripting console for more advanced queries. Data can also be exported as JSON for custom analysis, or in Heaptrack format to use with a third-party analysis tool.

Bytehound supports common Linux hardware architectures including AMD64, ARM, AArch64, and MIPS64. It works with programs that use the standard system memory allocator as well as jemalloc, an alternative allocator popular in performance-sensitive applications. It can also stream profiling data over a network to a separate machine, which is useful when the machine being profiled does not have enough storage to save the data locally.

Where it fits