{"id":24551934,"url":"https://github.com/mlabs-haskell/cardano-serialization-lib-gc","last_synced_at":"2025-04-15T22:20:08.257Z","repository":{"id":183979941,"uuid":"670600910","full_name":"mlabs-haskell/cardano-serialization-lib-gc","owner":"mlabs-haskell","description":"cardano-serialization-lib with custom garbage collector for WASM ","archived":false,"fork":false,"pushed_at":"2024-11-18T16:38:02.000Z","size":42,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T09:19:49.260Z","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/mlabs-haskell.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":"2023-07-25T12:17:12.000Z","updated_at":"2024-11-18T16:35:51.000Z","dependencies_parsed_at":"2024-01-07T19:38:09.593Z","dependency_job_id":"ac2a3c19-8515-47c1-84a4-e8f3806122df","html_url":"https://github.com/mlabs-haskell/cardano-serialization-lib-gc","commit_stats":null,"previous_names":["mlabs-haskell/cardano-serialization-lib-gc"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fcardano-serialization-lib-gc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fcardano-serialization-lib-gc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fcardano-serialization-lib-gc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fcardano-serialization-lib-gc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlabs-haskell","download_url":"https://codeload.github.com/mlabs-haskell/cardano-serialization-lib-gc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161801,"owners_count":21222555,"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-01-23T01:19:28.117Z","updated_at":"2025-04-15T22:20:08.236Z","avatar_url":"https://github.com/mlabs-haskell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cardano-serialization-lib-gc\n\nThis is a small ESM library that provides a wrapper for managing garbage collection for  [cardano-serialization-library](https://github.com/Emurgo/cardano-serialization-lib). It does this by using a `FinalizationRegistry` object to keep track of objects that are no longer in use, and calling the `free()` method on them when they are finalized.\n\nExample usage with NodeJS:\n\n```javascript\nimport * as lib from \"@mlabs-haskell/cardano-serialization-lib-gc\";\n\nfunction fixture() {\n  lib.PlutusData.new_bytes(\n    new Uint8Array(Array(10000000).fill(0))\n  );\n}\n\nsetInterval(() =\u003e {\n  for (let i = 0; i \u003c 10; i++) {\n    fixture()\n  }\n}, 500) // collection of unused objects will trigger `free()` calls\n// for the corresponding WASM-allocated memory\n```\n\nThis code will not leak, but if you try to use the original package, the memory usage will steadily grow.\n\nIf you want to use this library as a CommonJS module, use legacy [csl-gc-wrapper](https://github.com/mlabs-haskell/csl-gc-wrapper) instead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabs-haskell%2Fcardano-serialization-lib-gc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlabs-haskell%2Fcardano-serialization-lib-gc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabs-haskell%2Fcardano-serialization-lib-gc/lists"}