{"id":28471670,"url":"https://github.com/rocicorp/heap-snapshot","last_synced_at":"2025-07-01T22:31:04.616Z","repository":{"id":297074366,"uuid":"995571750","full_name":"rocicorp/heap-snapshot","owner":"rocicorp","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-03T17:50:14.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-04T03:14:38.398Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/rocicorp.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,"zenodo":null}},"created_at":"2025-06-03T17:27:43.000Z","updated_at":"2025-06-03T23:06:43.000Z","dependencies_parsed_at":"2025-06-04T03:14:44.761Z","dependency_job_id":"a50ebb12-755e-4087-99c4-4bc061f7e36f","html_url":"https://github.com/rocicorp/heap-snapshot","commit_stats":null,"previous_names":["rocicorp/heap-snapshot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rocicorp/heap-snapshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fheap-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fheap-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fheap-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fheap-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocicorp","download_url":"https://codeload.github.com/rocicorp/heap-snapshot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fheap-snapshot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263046108,"owners_count":23405132,"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":[],"created_at":"2025-06-07T11:08:24.396Z","updated_at":"2025-07-01T22:31:04.603Z","avatar_url":"https://github.com/rocicorp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @rocicorp/heap-snapshot\n\nIt is often the case that we need to get a heap snapshot from running `zero-cache` processes.\n\nOnline guides and documentation suggest using the `chrome-remote-interface` package and then calling `v8.writeHeapSnapshot()`.\n\nDoing this for `zero-cache` yields much smaller snapshots than those you get if you connect to the node process in Chrome's devtools and get a snapshot that way. These smaller snapshots lack many core classes of zero-cache such as `ViewSyncer`.\n\nI do not understand why but ChatGPT suggests that the implementation of `v8.writeHeapSnapshot()` is different and simpler than the `HeapProfiler` class that Chrome itself uses, and misses some \"uncommon\" allocation patterns 😬.\n\nThis tool automates using the lower-level `HeapProfiler` class to create a dump that contains all of `zero-cache`'s objects.\n\n## Usage\n\n1. `kill -USR1 \u003cpid-to-snapshot\u003e`\n2. The targetted process prints out a message like: `Debugger listening on ws://127.0.0.1:9229/a8712980-d35d-434f-824c-db212b277b5e`\n3. `npx @rocicorp/heap-snapshot \u003cthat-url\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocicorp%2Fheap-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocicorp%2Fheap-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocicorp%2Fheap-snapshot/lists"}