Fundamentals 4 min read

Bytehound: Linux Memory Profiling Tool – Features, Installation, Usage, and Environment Variables

Bytehound is a Linux memory analysis tool that offers detailed memory usage curves, allocation tracking, stack traces, and a web GUI, with support for multiple architectures, export formats, and configurable environment variables for flexible profiling and debugging.

Sohu Tech Products
Sohu Tech Products
Sohu Tech Products
Bytehound: Linux Memory Profiling Tool – Features, Installation, Usage, and Environment Variables

Bytehound is a Linux memory analysis tool that provides memory usage curves, detailed allocation information, and full stack traces to help diagnose memory leaks and fragmentation.

Key features include precise leak detection, full stack tracking for each allocation and free, dynamic exclusion of temporary allocations, high‑performance custom stack display, export to JSON, Heaptrack, and flame graphs, a web‑based GUI, streaming of profiling data to another machine, and support for AMD64, ARM, AArch64, MIPS64 (with kernel patch), jemalloc on AMD64, and an embedded Rhai DSL for programmable analysis.

Project repository: https://github.com/koute/bytehound

Installation

$ cargo build --release -p bytehound-preload
$ cargo build --release -p bytehound-cli

After building, retrieve the binaries from target/release/libbytehound.so or target/release/bytehound .

Basic usage

$ export MEMORY_PROFILER_LOG=warn
$ LD_PRELOAD=./libbytehound.so ./your_application
$ ./bytehound server memory-profiling_*.dat

Then open a browser at http://localhost:8080 to view the GUI.

Enabling debug logs

Debug logging is disabled by default for performance; to enable, rebuild with the debug-logs feature:

$ cd preload
$ cargo build --release --features debug-logs

Environment variables

MEMORY_PROFILER_OUTPUT – default memory‑profiling_%e_%t_%p.dat , supports placeholders %p (PID), %t (epoch seconds), %e (executable name), %n (incremental counter).

MEMORY_PROFILER_LOG – sets log level (trace, debug, info, warn, error).

MEMORY_PROFILER_LOGFILE – file path for log output; if unset, logs go to stderr with similar placeholders.

MEMORY_PROFILER_CULL_TEMPORARY_ALLOCATIONS – default 0; set to 1 to omit temporary allocations from output, useful for long‑term analysis.

MEMORY_PROFILER_PRECISE_TIMESTAMPS – default 0; set to 1 for per‑event timestamps, increasing precision at the cost of CPU usage.

rustLinuxperformance analysisMemory ProfilingBytehoundEnvironment Variables
Sohu Tech Products
Written by

Sohu Tech Products

A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.