{"id":34251998,"url":"https://github.com/casper-network/datasize-rs","last_synced_at":"2026-01-11T17:03:25.702Z","repository":{"id":42003031,"uuid":"298081093","full_name":"casper-network/datasize-rs","owner":"casper-network","description":"Heap memory usage estimation","archived":false,"fork":false,"pushed_at":"2024-01-10T14:21:51.000Z","size":199,"stargazers_count":19,"open_issues_count":7,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-19T21:55:07.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casper-network.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-09-23T20:01:43.000Z","updated_at":"2025-07-29T01:54:59.000Z","dependencies_parsed_at":"2024-01-10T16:07:09.482Z","dependency_job_id":"94dab8fb-4af6-4bc5-84c6-9ff2d8e05fbb","html_url":"https://github.com/casper-network/datasize-rs","commit_stats":{"total_commits":113,"total_committers":10,"mean_commits":11.3,"dds":"0.16814159292035402","last_synced_commit":"f4168720febad0e82fcdd08ab6a655f1381e0b64"},"previous_names":["casperlabs/datasize-rs"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/casper-network/datasize-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casper-network%2Fdatasize-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casper-network%2Fdatasize-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casper-network%2Fdatasize-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casper-network%2Fdatasize-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casper-network","download_url":"https://codeload.github.com/casper-network/datasize-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casper-network%2Fdatasize-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-12-16T10:56:42.852Z","updated_at":"2026-01-11T17:03:25.686Z","avatar_url":"https://github.com/casper-network.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# data_size::\u0026lt;T\u0026gt;(\u0026T)\n\nThe `datasize` crate is used for for estimating the heap memory usage of values, e.g. the number of bytes used by a `Vec` outside its on-stack size determined by `mem::size_of`.\n\n`datasize` is intended for rough benchmarks, typically to find memory hogs (it won't find memory leaks, as memory that is not reachable will not be reported). While it may not give entirely accurate readings in all situations, it will quickly identify low-hanging fruit.\n\n## Example\n\nThe `DataSize` trait is implemented for many primitive and `std` types, and can be derived for `structs` and others:\n\n```rust\nuse datasize::DataSize;\n\n#[derive(DataSize)]\nstruct Example {\n    count: usize,\n    my_data: Vec\u003cMyStruct\u003e,\n    warning: Option\u003cBox\u003cu32\u003e\u003e,\n    #[data_size(skip)]\n    skipped: Box\u003cchar\u003e,\n}\n```\n\nAny instance `ex` of the `Example` can now report an estimate of its heap allocation through `data_size(\u0026ex)`.\n\n## Other works\n\nOther crates suitable for this task are [`heapsize`](https://docs.rs/heapsize/) and [`malloc_size_of`](https://github.com/servo/servo/tree/faf3a183f3755a9986ec4379abadf3523bd8b3c0/components/malloc_size_of). Unfortunately the `heapsize` crate has been discontinued and the `malloc_size_of` crate puts some rather heavy constraints on what allocator can be used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasper-network%2Fdatasize-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasper-network%2Fdatasize-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasper-network%2Fdatasize-rs/lists"}