{"id":22134122,"url":"https://github.com/cppcoffee/c-memleak","last_synced_at":"2026-04-28T23:02:10.919Z","repository":{"id":265686863,"uuid":"896419285","full_name":"cppcoffee/c-memleak","owner":"cppcoffee","description":"Tracking C/C++ application memory usage dynamically.","archived":false,"fork":false,"pushed_at":"2024-12-22T11:58:12.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T15:13:18.884Z","etag":null,"topics":["aya","ebpf","memleak","rust","uprobes"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cppcoffee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-30T10:08:33.000Z","updated_at":"2024-12-22T11:58:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad322892-5ccd-490b-905f-0ac5c52cf800","html_url":"https://github.com/cppcoffee/c-memleak","commit_stats":null,"previous_names":["cppcoffee/c-memleak"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fc-memleak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fc-memleak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fc-memleak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fc-memleak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cppcoffee","download_url":"https://codeload.github.com/cppcoffee/c-memleak/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245248013,"owners_count":20584460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aya","ebpf","memleak","rust","uprobes"],"created_at":"2024-12-01T19:09:31.909Z","updated_at":"2026-04-28T23:02:05.881Z","avatar_url":"https://github.com/cppcoffee.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# c-memleak\n\n## Prerequisites\n\n1. stable rust toolchains: `rustup toolchain install stable`\n1. nightly rust toolchains: `rustup toolchain install nightly --component rust-src`\n1. (if cross-compiling) rustup target: `rustup target add ${ARCH}-unknown-linux-musl`\n1. (if cross-compiling) LLVM: (e.g.) `brew install llvm` (on macOS)\n1. (if cross-compiling) C toolchain: (e.g.) [`brew install filosottile/musl-cross/musl-cross`](https://github.com/FiloSottile/homebrew-musl-cross) (on macOS)\n1. bpf-linker: `cargo install bpf-linker` (`--no-default-features` on macOS)\n\n\n## Build\n\n```shell\n$ AYA_BUILD_EBPF=true cargo build --release\n```\n\nor\n\n```shell\n$ make\n```\n\n\n## Cross-compiling on macOS\n\nCross compilation should work on both Intel and Apple Silicon Macs.\n\n```shell\nCC=${ARCH}-linux-musl-gcc cargo build --package c-memleak --release \\\n  --target=${ARCH}-unknown-linux-musl \\\n  --config=target.${ARCH}-unknown-linux-musl.linker=\\\"${ARCH}-linux-musl-gcc\\\"\n```\nThe cross-compiled program `target/${ARCH}-unknown-linux-musl/release/c-memleak` can be\ncopied to a Linux server or VM and run there.\n\n\n## Usage\n\n```shell\nUsage: c-memleak [OPTIONS] --pid \u003cPID\u003e\n\nOptions:\n  -p, --pid \u003cPID\u003e          pid of the process\n  -t, --timeout \u003cTIMEOUT\u003e  timeout in seconds [default: 30]\n  -o, --output \u003cOUTPUT\u003e    output file [default: /tmp/memleak.out]\n  -v, --verbose            verbose mode\n  -h, --help               Print help\n  -V, --version            Print version\n```\n\n\n### Example:\n\n```shell\n# ./target/release/c-memleak --pid 20088\n```\n\nThe Target `redis-server` build with MALLOC=libc, generating flame graphs:\n\n```shell\n# ./FlameGraph/flamegraph.pl /tmp/memleak.out \u003e /tmp/1.svg\n```\n\nFlame graph:\n\n![flamegraph](images/1.svg)\n\n\n## Reference\n\n[https://github.com/iovisor/bcc/blob/master/libbpf-tools/memleak.bpf.c](https://github.com/iovisor/bcc/blob/master/libbpf-tools/memleak.bpf.c)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppcoffee%2Fc-memleak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcppcoffee%2Fc-memleak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppcoffee%2Fc-memleak/lists"}