{"id":17168568,"url":"https://github.com/jfrimmel/cargo-size","last_synced_at":"2025-10-12T23:15:43.366Z","repository":{"id":98820070,"uuid":"164248238","full_name":"jfrimmel/cargo-size","owner":"jfrimmel","description":"a custom command extending 'cargo' to print the memory usage","archived":false,"fork":false,"pushed_at":"2019-01-06T11:11:57.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-29T23:23:11.078Z","etag":null,"topics":["cargo","cargo-plugin","cargo-subcommand","rust","size-calculation"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jfrimmel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-01-05T20:21:03.000Z","updated_at":"2024-11-06T03:24:24.000Z","dependencies_parsed_at":"2023-04-13T15:22:26.849Z","dependency_job_id":null,"html_url":"https://github.com/jfrimmel/cargo-size","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrimmel%2Fcargo-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrimmel%2Fcargo-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrimmel%2Fcargo-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrimmel%2Fcargo-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfrimmel","download_url":"https://codeload.github.com/jfrimmel/cargo-size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245330219,"owners_count":20597734,"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":["cargo","cargo-plugin","cargo-subcommand","rust","size-calculation"],"created_at":"2024-10-14T23:12:13.924Z","updated_at":"2025-10-12T23:15:38.308Z","avatar_url":"https://github.com/jfrimmel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-size\n\u003e a custom command extending `cargo` to print the memory usage\n\n# Dependencies\n- `cargo` is required for building the crate you want to display the size of.\n\n# Usage\nExecuting `cargo size` in a crate (root or a subdirectory) with a file `memory.x` present in the crate root builds the development binary and prints an output similar to:\n```\n$ cargo size\n   Finished dev [unoptimized + debuginfo] target(s) in 0.37s\n   Printing Memory Usage\n            ------------\n            Program:   55652 bytes (42.5% full)\n            Data:          8 bytes (0.0% full)\n```\nThe command `cargo size --release` does the same, but builds the release binary if necessary and prints its size.\n\nIf the file `memory.x` is not found or is invalid the percentages are omitted, without any error or warning message:\n```\n$ cargo size\n   Finished dev [unoptimized + debuginfo] target(s) in 0.01s\n   Printing Memory Usage\n            ------------\n            Program: 1486351 bytes\n            Data:       4656 bytes\n```\nThe file `memory.x` has to contain a `MEMORY` directive with at least the two sections `flash` and `ram` (case is ignored). The size of those two memories is used to calculate the percentages.\n\nIf the binary (either the development or the release one, as specified) is not up-to-date, cargo is used to build it.\n\n# Errors\nIf any error is detected, the application emits an error message and exits with the exit code `1` to indicate failure.\n\nPossible errors include:\n- The program was started in a directory, which is not a cargo project (subdirectories of such a project are perfectly fine).\n- The manifest file `Cargo.toml` is present, but could not be parsed, e.g. the crate name is missing.\n- The build command failed, e.g. the code contains an error.\n- The binary was built successfully, but could not be found in the target directory. This is most likely if you are cross-compiling code for another platform. Then the binary is located in a subdirectory named as the target. The application tries some known platform, but if yours is not known yet, the command will fail.\n- The binary has an invalid format, e.g. it is not an ELF-file or it is corrupt.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrimmel%2Fcargo-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfrimmel%2Fcargo-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrimmel%2Fcargo-size/lists"}