{"id":20806305,"url":"https://github.com/nodesource/massive-heap-snapshot-parser","last_synced_at":"2025-05-11T17:31:44.034Z","repository":{"id":57149519,"uuid":"78774839","full_name":"nodesource/massive-heap-snapshot-parser","owner":"nodesource","description":"small library for parsing massively massive snapshots and giving you a way to access its contents sanely","archived":true,"fork":false,"pushed_at":"2017-01-13T00:35:36.000Z","size":21,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T11:54:25.562Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodesource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-12T18:31:18.000Z","updated_at":"2025-02-03T16:53:45.000Z","dependencies_parsed_at":"2022-09-03T18:11:32.515Z","dependency_job_id":null,"html_url":"https://github.com/nodesource/massive-heap-snapshot-parser","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fmassive-heap-snapshot-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fmassive-heap-snapshot-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fmassive-heap-snapshot-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodesource%2Fmassive-heap-snapshot-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodesource","download_url":"https://codeload.github.com/nodesource/massive-heap-snapshot-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253604837,"owners_count":21934905,"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":"2024-11-17T19:19:12.923Z","updated_at":"2025-05-11T17:31:43.750Z","avatar_url":"https://github.com/nodesource.png","language":"JavaScript","readme":"## Massive Heap Snapshot Parser\n\n### Install\n\nTo install just do:\n```\n$ npm install mhsp\n```\n\n### Usage\n\nThis API will extract `\"snapshot\"`, `\"nodes\"`, `\"edges\"` and `\"strings\"` from\nvery large snapshots in a way that allows you to continue working with them. It\ndoesn't however show `\"trace_function_infos\"`, `\"trace_tree\"` or `\"samples\"`.\nMainly because I don't need them right now. File an issue or open a PR if you'd\nlike to help.\n\n#### `parseSnapshot(path)`\n\n* Returns `DataAccessor` instance\n\nThis does all the magic. Just give it a path to a snapshot and it'll\nautomatically do everything for you. Here's an example:\n\n```js\n'use strict';\nconst { parseSnapshot } = require('mhsp');\n\nconst accessor = parseSnapshot('./my-big.heapsnapshot');\n```\n\nWarning that for large snapshots this can take several minutes. \n\n#### `accessor.snapshot`\n\n* Is `Object`\n\nThis is the metadata object that contains various information about the\nsnapshot.\n\n#### `accessor.nodes`\n\n* Is a `Uint32Array`\n\nThis is a `Uint32Array` of all the nodes in the snapshot. Go ahead and access\nit by index.\n\n#### `accessor.edges`\n\n* Is a `Uint32Array`\n\nThis is also a `Uint32Array` that can be accessed by index.\n\n#### `accessor.getString(index)`\n\n* Returns `String`\n\nReturning strings from the `\"strings\"` field isn't as straight forward. Some\nfun index tracking is done under the hood so the entire `\"strings\"` section can\nlive in one big `Buffer`.\n\n#### `accessor.writeToFile(path)`\n\n* Returns `Number` of bytes written to disk\n\nSince generating the accessor takes so long you can go ahead and write the\nentire thing to disk in the form of a binary blob. Can then use `importBin()`\nto read it back in later. Is much much faster.\n\n#### `importBin(path)`\n\n* Returns `DataAccessor` instance\n\nRead in files that have already been processed and written to disk as binary\nblobs. On my i7 the first time I process a 2GB snapshot can take over 1.5\nminutes. But reading it back in this way only takes a few seconds. Highly\nrecommended.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Fmassive-heap-snapshot-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodesource%2Fmassive-heap-snapshot-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesource%2Fmassive-heap-snapshot-parser/lists"}