Show HN: I wrote a tool in Rust for tracking all allocations in a Linux process

allocscope banner

allocscope

a memory tracking tool

allocscope is a tool for tracking down where the most egregiously large allocations are occurring
in a C, C++ or Rust codebase. It is particilarly intendend to be useful for developers who want to
get a handle on excessive allocations and are working in a large codebase with multiple
contributors with allocations occuring in many modules or libraries.

It is composed of two commands:

allocscope-trace attaches to another process as a debugger. By using breakpoints on memory
allocation functions such as malloc it tracks allocations made by that process. During the
trace, the callstack of all allocations are recorded to an .atrace file. Tracing programs
which spawn multiple threads and tracing calls through shared libraries are supported. You can
spawn a process to trace by specifying a full commandline to allocscope-trace, or you can
attach to an existing running process.

allocscope-view reads the .atrace file produced by allocscope-trace. It presents a summary
of all allocations made in a call tree format, which can be sorted by largest concurrent
allocation, total number of blocks, number of unfreed allocation blocks, or the sequence of
the allocation. The summary can be navigated interactively through a curses-based terminal user
interface, or a text report suitable for non-interactive use can be generated.

Installing prebuilt binaries

The easiest way to get started with allocscope is to install prebuilt binaries.

To install the latest version:

curl -s https://allocscope.com/install.sh | sudo sh

Currently only Linux on x86_64 processors is supported, but I’d like to support more operating systems
and processors in the future.

Getting started

While it will be likely be most useful to use allocscope on a program with symbols, which you
have compiled yourself, you can verify that it functions correctly by performing a trace on a
standard system command, such as ls:

allocscope-trace ls -l
allocscope-view ls.atrace

Building from source

On recent Ubuntu releases, allocscope can be built from source with the following sequence
of commands:

apt-get update
apt-get install cargo git libclang-dev libiberty-dev libncurses-dev libsqlite3-dev libunwind-dev
git clone https://github.com/matt-kimball/allocscope.git
cd allocscope
cargo install --path allocscope-trace
cargo install --path allocscope-view

Statically linked binaries can also be built using the build-static/build.sh script, though this requires
Docker installed on the build system.

Support development

If you find allocscope useful, please consider supporting development.

Visit https://allocscope.com/support

License

allocscope is licensed GNU General Public License version 3.

Read More
Tama Pingree

Latest

Interview: August Burns Red’s Jake Luhrs Talks New Album & Oz Tour

Photo by Sergio Martin ©Spotlight Report AUGUST BURNS RED needs no introduction. Releasing Season of Surrender, their tenth and most vital record to date, iconic frontman, JAKE LUHRS, spoke to...

Roiea – No Worry

No Worry: The Latest Single from Nigerian & Freeme Digital LTD Signed Artist, Roiea Nigerian & Freeme Digital LTD signed artist, singer-songwriter and performer, Roiea, is back with a fresh new track titled "No Worry". This exciting release marks another milestone in the artist’s growing career and...

Trump envoys head to Switzerland for potential Iran talks

White House envoy Steve Witkoff is on his way to Switzerland, where the first round of talks with Iran on a potential nuclear deal is expected to take place, a U.S. official told Axios.The U.S. official said Trump's envoy Jared Kushner is already in Switzerland. Why it matters: The talks were supposed to start on

Josep Garcia claims fastest Akrapovic Super Test time at FIM EnduroGP of Portugal II

The Paulo Duarte FIM EnduroGP World Championship returned to action in Fafe, Portugal, for round five with Friday’s action-packed Akrapovic Super Test. With FIM EnduroGP staying in Fafe for round five, GP of Portugal II, the Akrapovic Super Test delivered another thrilling night of racing. This time the course was run in [...] The post

Newsletter

Don't miss

Interview: August Burns Red’s Jake Luhrs Talks New Album & Oz Tour

Photo by Sergio Martin ©Spotlight Report AUGUST BURNS RED needs no introduction. Releasing Season of Surrender, their tenth and most vital record to date, iconic frontman, JAKE LUHRS, spoke to...

Roiea – No Worry

No Worry: The Latest Single from Nigerian & Freeme Digital LTD Signed Artist, Roiea Nigerian & Freeme Digital LTD signed artist, singer-songwriter and performer, Roiea, is back with a fresh new track titled "No Worry". This exciting release marks another milestone in the artist’s growing career and...

Trump envoys head to Switzerland for potential Iran talks

White House envoy Steve Witkoff is on his way to Switzerland, where the first round of talks with Iran on a potential nuclear deal is expected to take place, a U.S. official told Axios.The U.S. official said Trump's envoy Jared Kushner is already in Switzerland. Why it matters: The talks were supposed to start on

Josep Garcia claims fastest Akrapovic Super Test time at FIM EnduroGP of Portugal II

The Paulo Duarte FIM EnduroGP World Championship returned to action in Fafe, Portugal, for round five with Friday’s action-packed Akrapovic Super Test. With FIM EnduroGP staying in Fafe for round five, GP of Portugal II, the Akrapovic Super Test delivered another thrilling night of racing. This time the course was run in [...] The post

Winning ride for Josep Garcia on day one at FIM EnduroGP of Portugal II

Fast and frantic racing sees Red Bull KTM Factory Racing’s Josep Garcia take the day one win at round five of the Paulo Duarte FIM EnduroGP World Championship in Fafe, Portugal. Day one win for Garcia in EnduroGP Debut victory for Canada’s Shelby Turner in Expotrade Women’s Enduro Joyon wins again in [...] The post

‘Sabah is open for business’: Hajiji courts investors with promise of sustainable growth, carbon‑negative credentials

Sabah is pitching itself as an Asia-Pacific hub for impact investing, betting that its forests, biodiversity and natural resources can become drivers of economic growth as it seeks private capital for sustainable development. — Picture by Firdaus Latif By Julia Chan First Published: Monday, 13 Jul 2026 11:44 AM MYT KOTA KINABALU, July 13 —

Want Your Business to Be Seen Everywhere? Meet Tonia Ryan, Creator of Fix Your Search

Some people are good at their jobs. Then there is Tonia Ryan, who has turned “getting found online” into something close to magic. She is the creator of Fix Your Search, and if you have ever wondered why some businesses pop up everywhere while others seem invisible...

Grey Business processes $61 million as stablecoins dominate payments

Grey Business enables startups and SMEs to open US Dollar (USD) corporate accounts, send and receive international payments, convert currencies, and transact using stablecoins such as USDC and USDT...