https://github.com/matt-kimball/allocscope Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} matt-kimball / allocscope Public * Notifications * Fork 5 * Star 181 allocscope - a memory tracking tool License GPL-3.0 license 181 stars 5 forks Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights matt-kimball/allocscope This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 1 tag Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/m] Use Git or checkout with SVN using the web URL. [gh repo clone matt-k] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @matt-kimball matt-kimball Added more detail to README.md ... d78748e Feb 13, 2023 Added more detail to README.md d78748e Git stats * 5 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time allocscope-trace Use a custom libunwind memory accessor for performance February 10, 2023 08:42 allocscope-view Updated README with build instructions February 11, 2023 15:39 build-static Initial public version of allocscope February 2, 2023 13:51 .gitignore Initial public version of allocscope February 2, 2023 13:51 COPYING Initial public version of allocscope February 2, 2023 13:51 Cargo.toml Initial public version of allocscope February 2, 2023 13:51 README.md Added more detail to README.md February 13, 2023 10:41 View code allocscope a memory tracking tool Installing prebuilt binaries Getting started Building from source Support development License README.md 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. About allocscope - a memory tracking tool Topics cplusplus memory-leaks rust-lang memory-allocation memory-profiler memory-leak-detection c-programming Resources Readme License GPL-3.0 license Stars 181 stars Watchers 1 watching Forks 5 forks Releases 1 0.1.0 Latest Feb 15, 2023 Packages 0 No packages published Languages * Rust 96.5% * Shell 2.0% * Dockerfile 1.5% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.