{"id":16022783,"url":"https://github.com/slimsag/darfree","last_synced_at":"2025-08-18T15:32:16.912Z","repository":{"id":81015042,"uuid":"94173643","full_name":"slimsag/darfree","owner":"slimsag","description":"Uses black magic to release memory on Darwin.","archived":false,"fork":false,"pushed_at":"2017-06-13T05:42:45.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T18:48:35.338Z","etag":null,"topics":["2017","black","darfree","dontuse","go","golang","lower","magic","memory","normal","pleasedonotuse","seriously","than","trending","usage"],"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/slimsag.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":"2017-06-13T05:41:50.000Z","updated_at":"2022-06-09T14:15:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f304522-c192-4d97-842a-20f8dbfe956f","html_url":"https://github.com/slimsag/darfree","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/slimsag%2Fdarfree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimsag%2Fdarfree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimsag%2Fdarfree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimsag%2Fdarfree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slimsag","download_url":"https://codeload.github.com/slimsag/darfree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230245244,"owners_count":18196135,"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":["2017","black","darfree","dontuse","go","golang","lower","magic","memory","normal","pleasedonotuse","seriously","than","trending","usage"],"created_at":"2024-10-08T18:41:48.553Z","updated_at":"2024-12-18T09:21:05.142Z","avatar_url":"https://github.com/slimsag.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Package darfree uses black magic to release memory on Darwin.\n\ndarfree is a package that uses ⚫️ black magic (assembly and runtime monkey\npatching) to lower the perceived memory consumption of Go programs on\nDarwin / amd64 (Mac OS) systems. Since it is based on page size, the actual\n'gains' are dependent upon the program itself. They can be as much as your\nlargest heap allocation. See cmd/darfree for an example which uses ~500MB\nwithout darfree, and only ~17MB with.\n\n## Background\n\nGo allocates memory in pages, and later advises the operating system that it\nmay free unneeded memory using madvise(..., MADV_FREE) calls. On Linux, this\nsystem call immediately frees the memory page. However, on Darwin machines\nthe kernel will decide to retain that memory as part of your program's RSS\n(residential set size) until memory pressure by your application or another\nrunning on the system causes the kernel to _truly_ free that memory.\nIn reality, Darwin does the right thing. Keeping the memory as part of your\nprogram's RSS causes no harm, and actually benefits your program by making\nsubsequent allocations faster. However, from a user's perspective looking at\ntheir \"Activity Monitor\" it will look like your application is leaking or\nusing much more memory than it actually is. That is what darfree solves.\n\n## Beware\n\nI advise you really do not use this package at all, unless you really\nunderstand what is going on and what the trade-offs are. At any point in\ntime this package may become unmaintained, and may break with future Go\nversions.\n\n## Usage\n\n```Go\npackage main\n\nimport _ \"github.com/slimsag/darfree\"\n\nfunc main() {\n  // ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimsag%2Fdarfree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslimsag%2Fdarfree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimsag%2Fdarfree/lists"}