{"_id":"@arthurkim/memtop","_rev":"7-f74f6995d1e019a9a17ddd76b1f18e70","name":"@arthurkim/memtop","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.3":{"name":"@arthurkim/memtop","version":"0.0.3","keywords":["memory","top","htop","monitor"],"author":{"name":"Arthur Kim"},"license":"MIT","_id":"@arthurkim/memtop@0.0.3","maintainers":[{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"}],"homepage":"https://github.com/kimdwkimdw/memtop#readme","bugs":{"url":"https://github.com/kimdwkimdw/memtop/issues"},"bin":{"memtop":"dist/bin/memtop.js"},"dist":{"shasum":"474303af23d871944febb337ee4dd1f537b973bd","tarball":"https://registry.npmjs.org/@arthurkim/memtop/-/memtop-0.0.3.tgz","fileCount":9,"integrity":"sha512-iWYjX/4fjZyTFH/IZxdGDVyLES/HUWyjQV5COfwMCBLYO03ANazueb7fB0SdVAXY9D+HEPhi0OMCthF82GYznw==","signatures":[{"sig":"MEUCIQD/7OlXxeUAvTYx0tMfB7vowfeV+ZrA+Yvo1lvqN1qAFAIgEPxybBJuYsE+Mq84ikxzzT8hJF4x9onUm26wk+noaXQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7800070},"main":"dist/bin/memtop.js","type":"module","_from":"file:release-assets/npm/arthurkim-memtop-0.0.3.tgz","private":false,"scripts":{"dev":"pnpm run build:ts && node ./dist/bin/memtop.js","once":"pnpm run build:ts && node ./dist/bin/memtop.js --once","test":"pnpm run build:ts && node ./dist/bin/cargo.js test","build":"pnpm run build:ts && node ./dist/bin/cargo.js build --release","check":"pnpm run build:ts && node ./dist/bin/cargo.js check","start":"pnpm run build:ts && node ./dist/bin/memtop.js","prepack":"npm run build:ts","treemap":"pnpm run build:ts && node ./dist/bin/memtop.js","build:ts":"tsc -p tsconfig.json"},"_npmUser":{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"},"_resolved":"/home/runner/work/memtop/memtop/release-assets/npm/arthurkim-memtop-0.0.3.tgz","_integrity":"sha512-iWYjX/4fjZyTFH/IZxdGDVyLES/HUWyjQV5COfwMCBLYO03ANazueb7fB0SdVAXY9D+HEPhi0OMCthF82GYznw==","repository":{"url":"git+https://github.com/kimdwkimdw/memtop.git","type":"git"},"_npmVersion":"10.9.7","description":"Treemap-based memory monitor for your terminal","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.1","devDependencies":{"typescript":"^6.0.3","@types/node":"^25.8.0"},"_npmOperationalInternal":{"tmp":"tmp/memtop_0.0.3_1779147681451_0.009294808380378328","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@arthurkim/memtop","version":"0.0.4","keywords":["memory","top","htop","monitor"],"author":{"name":"Arthur Kim"},"license":"MIT","_id":"@arthurkim/memtop@0.0.4","maintainers":[{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"}],"homepage":"https://github.com/kimdwkimdw/memtop#readme","bugs":{"url":"https://github.com/kimdwkimdw/memtop/issues"},"bin":{"memtop":"bin/memtop"},"dist":{"shasum":"af696d91e7a5aaf7d7af019005295491b4a55fba","tarball":"https://registry.npmjs.org/@arthurkim/memtop/-/memtop-0.0.4.tgz","fileCount":8,"integrity":"sha512-wuy1LmMriV/4W9EQqAXUHzgyH/WY5W7mkYP0fFgQ3oPyBgzOcE/xndLLTASKDOfWCAPbjQzzs2Z/6LcAG7KJdA==","signatures":[{"sig":"MEQCIGIdgpvA5xaoz//vX1gxKSNkbegsoDKQNLMNCNiJiR7gAiA2FjRDV/TxiF02VOgGmfdgeC+5QRnB4IG29hgm0vurQQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7795952},"_from":"file:release-assets/npm/arthurkim-memtop-0.0.4.tgz","private":false,"scripts":{"dev":"scripts/cargo.sh run --quiet --","once":"scripts/cargo.sh run --quiet -- --once","test":"scripts/cargo.sh test --locked && bash scripts/test-npm-launcher.sh","build":"scripts/cargo.sh build --release","check":"scripts/cargo.sh check --locked","start":"scripts/cargo.sh run --quiet --","treemap":"scripts/cargo.sh run --quiet --","test:launcher":"bash scripts/test-npm-launcher.sh"},"_npmUser":{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"},"_resolved":"/home/runner/work/memtop/memtop/release-assets/npm/arthurkim-memtop-0.0.4.tgz","_integrity":"sha512-wuy1LmMriV/4W9EQqAXUHzgyH/WY5W7mkYP0fFgQ3oPyBgzOcE/xndLLTASKDOfWCAPbjQzzs2Z/6LcAG7KJdA==","repository":{"url":"git+https://github.com/kimdwkimdw/memtop.git","type":"git"},"_npmVersion":"10.9.8","description":"Treemap-based memory monitor for your terminal","directories":{},"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.1","_npmOperationalInternal":{"tmp":"tmp/memtop_0.0.4_1781767532898_0.20590922089796293","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@arthurkim/memtop","version":"0.0.5","keywords":["memory","top","htop","monitor"],"author":{"name":"Arthur Kim"},"license":"MIT","_id":"@arthurkim/memtop@0.0.5","maintainers":[{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"}],"homepage":"https://github.com/kimdwkimdw/memtop#readme","bugs":{"url":"https://github.com/kimdwkimdw/memtop/issues"},"bin":{"memtop":"bin/memtop"},"dist":{"shasum":"2a5ef6fa042c321e752ad18c04c475571a1ccd39","tarball":"https://registry.npmjs.org/@arthurkim/memtop/-/memtop-0.0.5.tgz","fileCount":8,"integrity":"sha512-Lf+W3ylufjWMQFDhpmtDrPME9UlxVuOsKXmL3O3h7CJs9Quphe8E09LweNn+AtXWCGPvmTg5hlv17MO7PcwmpQ==","signatures":[{"sig":"MEQCIGJjTBk4tcxa8YaZ80GCSbC9fhHZIxfC2dktxu7AUpMmAiBR8Q3/ZsxsnQwpUrwIsCHjRlv1rPRlFg2Bcg6bW25tTA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8178294},"_from":"file:release-assets/npm/arthurkim-memtop-0.0.5.tgz","private":false,"scripts":{"dev":"scripts/cargo.sh run --quiet --","once":"scripts/cargo.sh run --quiet -- --once","test":"scripts/cargo.sh test --locked && bash scripts/test-npm-launcher.sh","build":"scripts/cargo.sh build --release","check":"scripts/cargo.sh check --locked","start":"scripts/cargo.sh run --quiet --","treemap":"scripts/cargo.sh run --quiet --","test:launcher":"bash scripts/test-npm-launcher.sh"},"_npmUser":{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"},"_resolved":"/home/runner/work/memtop/memtop/release-assets/npm/arthurkim-memtop-0.0.5.tgz","_integrity":"sha512-Lf+W3ylufjWMQFDhpmtDrPME9UlxVuOsKXmL3O3h7CJs9Quphe8E09LweNn+AtXWCGPvmTg5hlv17MO7PcwmpQ==","repository":{"url":"git+https://github.com/kimdwkimdw/memtop.git","type":"git"},"_npmVersion":"10.9.8","description":"Treemap-based memory monitor for your terminal","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.1","_npmOperationalInternal":{"tmp":"tmp/memtop_0.0.5_1785509886862_0.4065000192661179","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@arthurkim/memtop","version":"0.0.6","private":false,"description":"Treemap-based memory monitor for your terminal","license":"MIT","bin":{"memtop":"bin/memtop"},"publishConfig":{"access":"public"},"scripts":{"start":"scripts/cargo.sh run --quiet --","dev":"scripts/cargo.sh run --quiet --","treemap":"scripts/cargo.sh run --quiet --","once":"scripts/cargo.sh run --quiet -- --once","build":"scripts/cargo.sh build --release","check":"scripts/cargo.sh check --locked","test:launcher":"bash scripts/test-npm-launcher.sh","test":"scripts/cargo.sh test --locked && bash scripts/test-npm-launcher.sh"},"packageManager":"pnpm@10.33.1","repository":{"type":"git","url":"git+https://github.com/kimdwkimdw/memtop.git"},"keywords":["memory","top","htop","monitor"],"author":{"name":"Arthur Kim"},"bugs":{"url":"https://github.com/kimdwkimdw/memtop/issues"},"homepage":"https://github.com/kimdwkimdw/memtop#readme","_id":"@arthurkim/memtop@0.0.6","_integrity":"sha512-GeXRNG2RvVSU43wejbf2neQOhgA66LCjkHtVUV6AhccvNuMPhcEGiEMdf/1gtql1RK32RxphkoRngxOphxsrSQ==","_resolved":"/home/runner/work/memtop/memtop/release-assets/npm/arthurkim-memtop-0.0.6.tgz","_from":"file:release-assets/npm/arthurkim-memtop-0.0.6.tgz","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-GeXRNG2RvVSU43wejbf2neQOhgA66LCjkHtVUV6AhccvNuMPhcEGiEMdf/1gtql1RK32RxphkoRngxOphxsrSQ==","shasum":"ac4881a4c259f0bbeac8f80177dab7aa8902b139","tarball":"https://registry.npmjs.org/@arthurkim/memtop/-/memtop-0.0.6.tgz","fileCount":8,"unpackedSize":8170945,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDp4fSzfRUQ+jHImak8hamRdXcrCGbvkM4+ntbaFXROnAIhAK9yYQ9ffgJiK+38fmZq8vXHpbqulgMzd6Eiz5fzdM6V"}]},"_npmUser":{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"},"directories":{},"maintainers":[{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memtop_0.0.6_1785941918838_0.1016987348771059"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T23:41:21.326Z","modified":"2026-08-05T14:58:39.200Z","0.0.2":"2026-05-18T23:27:12.586Z","0.0.3":"2026-05-18T23:41:21.758Z","0.0.4":"2026-06-18T07:25:33.137Z","0.0.5":"2026-07-31T14:58:07.077Z","0.0.6":"2026-08-05T14:58:39.048Z"},"bugs":{"url":"https://github.com/kimdwkimdw/memtop/issues"},"author":{"name":"Arthur Kim"},"license":"MIT","homepage":"https://github.com/kimdwkimdw/memtop#readme","keywords":["memory","top","htop","monitor"],"repository":{"type":"git","url":"git+https://github.com/kimdwkimdw/memtop.git"},"description":"Treemap-based memory monitor for your terminal","maintainers":[{"name":"arthurkim","email":"kimdwkimdw+npm@gmail.com"}],"readme":"# memtop\n\n<p align=\"center\">\n  <img src=\"assets/title.svg\" alt=\"memtop - project-aware process memory\" width=\"780\">\n</p>\n\n<p align=\"center\">\n  <strong>Project-aware process memory for your terminal.</strong><br>\n  Memory grouped the way developers think: by app, repo, container, and workspace.\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/kimdwkimdw/memtop/releases\"><img alt=\"GitHub release\" src=\"https://img.shields.io/github/v/release/kimdwkimdw/memtop?include_prereleases&style=flat-square\"></a>\n  <img alt=\"Project aware\" src=\"https://img.shields.io/badge/project-aware-34d399?style=flat-square\">\n  <img alt=\"Treemap\" src=\"https://img.shields.io/badge/view-treemap-38bdf8?style=flat-square\">\n  <img alt=\"Terminal\" src=\"https://img.shields.io/badge/terminal-native-facc15?style=flat-square\">\n</p>\n\n`memtop` is a live TUI treemap for Linux and macOS process memory. Instead of showing a flat list of `node`, `python`, `cargo`, browser helpers, and worker processes, it groups memory by the project or app those processes belong to.\n\n```text\n224.2 MiB   2.1%  memtop  (~/dev/private/memtop)\n 143.9 MiB         codex --yolo\n  28.3 MiB         node .../codex\n   6.8 MiB         target/debug/memtop --once\n```\n\n![memtop demo](assets/demo.gif)\n\n## Install\n\nInstall from npm or pnpm, then run `memtop` from any shell:\n\n```bash\nnpm install -g @arthurkim/memtop\n# or\npnpm install -g @arthurkim/memtop\nmemtop\n```\n\nCheck the installed command:\n\n```bash\nmemtop --version\n```\n\nThe npm tarball bundles prebuilt native binaries for:\n\n- `aarch64-apple-darwin`\n- `x86_64-apple-darwin`\n- `aarch64-unknown-linux-musl`\n- `x86_64-unknown-linux-musl`\n\nThe installed command is a POSIX shell launcher that execs the bundled native\nbinary, so `node` is not required at runtime after installation.\n\n## Usage\n\nRun the live treemap:\n\n```bash\nmemtop\n```\n\nPrint a non-interactive snapshot:\n\n```bash\nmemtop --once\n```\n\nUseful filters:\n\n```bash\nmemtop --top-projects 40\nmemtop --top-processes 16\nmemtop --min-memory-kib 8192\nmemtop --interval-ms 1000\nmemtop --group-by uid\n```\n\nChoose a memory metric:\n\n```bash\nmemtop --metric pss\nmemtop --metric uss\nmemtop --metric rss\n```\n\n## Why Grouping Matters\n\nModern development stacks rarely run as one obvious process. A single project can appear as:\n\n- `node`\n- `cargo`\n- `python`\n- `rust-analyzer`\n- `tsserver`\n- `worker`\n- app bundle helper processes\n- container children\n\n`memtop` recovers that context before drawing the memory map, so you can see whether a repo, desktop app, browser, container, or worker group is responsible for memory growth.\n\n## How Grouping Works\n\n`memtop` inspects process working directories, command paths, executable paths, macOS app bundles, and container metadata.\n\nIt recognizes project markers:\n\n```text\n.git\nCargo.toml\npackage.json\npyproject.toml\ngo.mod\nmise.toml\n```\n\nIt also recognizes workspace-style paths:\n\n```text\nproject\nprojects\nrepo\nrepos\nsrc\nworkspace\nworkspaces\n```\n\nOn macOS, processes from the same `/Applications/*.app`, `/System/Applications/*.app`, `/System/Library/CoreServices/*.app`, or `~/Applications/*.app` bundle are grouped together before repository fallback detection. That keeps apps such as Chrome and their helper processes under one app-level group.\n\nContainer metadata takes precedence when a process is known to belong to a container.\nWhen the Docker CLI is available, Docker container IDs are resolved to container names\nand Docker Compose project/service metadata.\nDocker does not record the host user that launched a container, but `memtop` displays it\nwhen the container has an optional `launcher.uid` label:\n\n```yaml\nservices:\n  worker:\n    labels:\n      launcher.uid: \"${LAUNCHER_UID:-}\"\n```\n\n```bash\nLAUNCHER_UID=\"$(id -u)\" docker compose up -d\n```\n\nOn Linux, `--group-by uid` groups processes by the real UID reported in `/proc/<pid>/status`. In the TUI, press `u` to toggle between project-aware grouping and UID grouping.\n\n## Navigation\n\n| Input | Action |\n| --- | --- |\n| `Up`, `Down`, `k`, `j` | Move through groups or processes |\n| `Enter`, `z` | Zoom into the selected group |\n| `Backspace`, `x` | Return to the group view |\n| `u` | Toggle project/UID grouping |\n| Mouse click | Select a project or process |\n| `r` | Refresh now |\n| `q`, `Esc` | Quit |\n\n## Memory Metrics\n\nOn Linux, `pss` and `uss` come from `/proc/<pid>/smaps_rollup`.\n\n- `pss` is usually the best attribution view because it divides shared pages across sharers.\n- `rss` is fastest, but shared pages can be counted multiple times.\n- `uss` focuses on private resident memory.\n\nOn macOS, the OS does not expose the same PSS/USS accounting through this CLI, so `memtop` uses RSS while preserving the same TUI and grouping behavior.\n\n`--scan-threads` controls Linux PSS/USS collection cost. The default `4` keeps CPU usage bounded. Use `--scan-threads 0` to use all available parallelism for faster exact snapshots at higher CPU and memory cost.\n\n## Limitations\n\nOn Linux, the first TUI frame can show inflated memory. This is intentional: when the requested metric is `pss` or `uss`, `memtop` opens with a fast RSS preview, then replaces it with the slower `smaps_rollup` result in the background.\n\nExample from a real host:\n\n```text\nRSS preview: process RSS sum 979.6 GiB, system used 88.1 GiB\nPSS refresh: process PSS sum  77.7 GiB, system used 88.7 GiB\n```\n\nThe `979.6 GiB` preview is not host memory usage. It is the sum of per-process RSS, so shared pages are counted once for every process that maps them. In the same snapshot:\n\n```text\ntraining group: 963.9 GiB RSS -> 63.1 GiB PSS\ntraining worker:  15.0 GiB RSS ->  1.5 GiB PSS\nserving group:     2.9 GiB RSS ->  2.0 GiB PSS\nserving worker:  692.6 MiB RSS -> 480.1 MiB PSS\n```\n\nThe header has two totals with different meanings:\n\n- `system used` comes from `/proc/meminfo` as `MemTotal - MemAvailable`. This is the kernel's host-wide memory pressure signal.\n- `process <metric> sum` is the sum of sampled processes above `--min-memory-kib`. It drives treemap tile sizes. It is an attribution view, so it will not exactly match `system used`.\n\nReading Linux `smaps_rollup` is slower because the kernel must summarize memory mappings for each process. If `smaps_rollup` cannot be read, that process falls back to RSS.\n\n## Development\n\nRun from source:\n\n```bash\ncargo run\n```\n\nRun a snapshot from source:\n\n```bash\ncargo run -- --once\n```\n\nYou can also use the package scripts as Cargo aliases:\n\n```bash\npnpm test\npnpm build\n```\n\nThe npm package exposes `bin/memtop`, a POSIX shell launcher that chooses the\nbundled `vendor/<target>/memtop` binary for the current Linux or macOS platform.\nSource checkouts run through Cargo directly; release packages do not depend on\nNode.js to start `memtop`.\n\n## Release\n\nGitHub Releases are built from version tags. The release workflow also publishes `@arthurkim/memtop` to npm, so the repository must have an `NPM_TOKEN` secret with publish access to that package.\n\n```bash\nVERSION=\"$(node -p \"require('./package.json').version\")\"\ngit tag -a \"v${VERSION}\" -m \"Release v${VERSION}\"\ngit push origin \"v${VERSION}\"\n```\n\nPushing the tag starts the `release` workflow automatically. To rerun a release, run **Actions > release > Run workflow** and enter the existing tag.\n\nThe workflow publishes:\n\n- `memtop-aarch64-apple-darwin.tar.gz`\n- `memtop-x86_64-apple-darwin.tar.gz`\n- `memtop-aarch64-unknown-linux-musl.tar.gz`\n- `memtop-x86_64-unknown-linux-musl.tar.gz`\n- npm package `@arthurkim/memtop`\n\nLinux archives are MUSL builds for broader distro compatibility. They are smoke-tested on the Ubuntu build runner and inside an Alpine container before upload. The npm package is also smoke-tested with `npm install -g` and `pnpm install -g` before it is published, with `node` blocked from the runtime `PATH`.\n","readmeFilename":"README.md"}