{"id":16703453,"url":"https://github.com/mtardy/cmemstat","last_synced_at":"2025-03-14T08:21:41.074Z","repository":{"id":248228502,"uuid":"827872902","full_name":"mtardy/cmemstat","owner":"mtardy","description":"Cgroups based memory stats utility","archived":false,"fork":false,"pushed_at":"2024-07-16T17:40:52.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T02:44:28.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/mtardy.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":"2024-07-12T15:04:52.000Z","updated_at":"2024-12-12T10:02:46.000Z","dependencies_parsed_at":"2024-07-16T21:24:04.805Z","dependency_job_id":"934404a4-de36-472b-83d7-5bb34d90c149","html_url":"https://github.com/mtardy/cmemstat","commit_stats":null,"previous_names":["mtardy/cmemstat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtardy%2Fcmemstat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtardy%2Fcmemstat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtardy%2Fcmemstat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtardy%2Fcmemstat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtardy","download_url":"https://codeload.github.com/mtardy/cmemstat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243544537,"owners_count":20308173,"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-10-12T19:08:22.929Z","updated_at":"2025-03-14T08:21:41.054Z","avatar_url":"https://github.com/mtardy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmemstat\n\nA utility to retrieve memory stats of a running process from the memory cgroup.\n\nHow does that work? The tool starts itself as a child process and `SIGSTOP`\nitself. The parent `wait4(2)` for the child state to be `stopped`, then creates\na cgroup using [libcontainer](https://github.com/opencontainers/runc/tree/main/libcontainer)\nand puts this init child process inside of it. Then the parent sends `SIGCONT`\nto the child that immediately executes the desired command, and finally, the\nparent periodically prints the cgroup memory stats. Almost nothing is performed\nby the child between `SIGSTOP` and `SIGCONT` so the memory measurement by the\ncgroup should be accurately associated to the target command.\n\n## Installation\n\n```shell\ngo install github.com/mtardy/cmemstat@latest\n```\n\n## Usage\n\n```shell\ncmemstat [option]... program [programoption]...\n```\n\nFor example, to retrieve the memory usage of `sleep 3` with the `--debug` option\nrefreshing the stats every 400ms:\n\n```shell\ncmemstat --debug --refresh 400ms sleep 3\n```\n\nOr with default options:\n\n```shell\ncmemstat sleep 3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtardy%2Fcmemstat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtardy%2Fcmemstat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtardy%2Fcmemstat/lists"}