HEAPTRACK(1)
β¨ NAME β¨
okay so heaptrack is a heap memory profiler for linux, and this one is the command line utility version of it. that's the whole vibe, no cap. π«Ά
also hiii, you're on the heaptrack(1) page β section one, User Commands, the iconic one. π
πΈ SYNOPSIS πΈ
like, here's how you actually run it:
heaptrack [--debug|-d] DEBUGGEE [ARGUMENT]...
heaptrack [--debug|-d] -p PID
π DESCRIPTION π
bestie. listen. it's a heap memory usage profiler. the way it works is it uses LD_PRELOAD to track literally every single call to the core memory allocation functions, and it logs all of those occurrences. π
on top of that, backtraces get obtained and logged too. put those two things together and suddenly you have interesting answers to questions like:
- How much heap memory is my application using?
- Where is heap memory being allocated, and how often?
- How much space are heap individual allocations requesting?
then, to actually go evaluate the heaptrack data you generated, you reach for heaptrack_print or heaptrack_gui. that's the duo. π
π Mandatory arguments to heaptrack π
DEBUGGEEβ the name or the path to the application that should be run with heaptrack analyzation enabled. you need this one, it's not optional, periodt.
π¦ Alternatively, to attach to a running process π¦
-p,--pidPID β the process ID of a running process that heaptrack will get injected into. important caveat bestie: this only works with applications that already link againstlibdl. so check that first, don't come crying to me. π
π Optional arguments to heaptrack π
-d,--debugβ runs the debuggee inside GDB and heaptrack. double the chaos, double the fun. π₯- ARGUMENT β any number of arguments, and they get passed verbatim to the debuggee. exactly as you typed them, no edits, no notes.
-h,--helpβ shows this help message and then exits. classic. π-v,--versionβ displays version information. the "which build am i even on" button. β
π SEE ALSO π
the full documentation for heaptrack is maintained as a Texinfo manual. so if the info and heaptrack programs are properly installed at your site, then this command:
info heaptrack
should give you access to the complete manual. go off, read the whole thing. πβ¨
and that's a wrap on the heaptrack(1) page, bestie β this was heaptrack 1.0.0, from March 2017, brought to you by the User Commands section. ty for coming to my ted talk, mwah πππ¦
π¦ where this page comes from
- debian bookworm: heaptrack 1.4.0-2 Β· LGPL-2.1-or-later
- debian trixie: heaptrack 1.5.0+dfsg1-5 Β· LGPL-2.1-or-later
- ubuntu jammy: heaptrack 1.3.0-1ubuntu1 Β· LGPL-2.1-or-later
- ubuntu noble: heaptrack 1.5.0+dfsg1-2ubuntu3 Β· LGPL-2.1-or-later
- ubuntu questing: heaptrack 1.5.0+dfsg1-4ubuntu5
- ubuntu resolute: heaptrack 1.5.0+dfsg1-6ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: heaptrack 1.5.0+dfsg1-6ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms