Memory management in 40 major C projects, a survey
Web page · https://theconsensus.dev/p/2026/11/08/c-memory-management-survey.html
First seen by Oriel on .
AI summary
A survey of 40 major C projects finds that most use memory-management strategies beyond malloc/free, including regions, garbage collection, reference counting, and scope-based cleanup.
- Only 8 projects allocate solely with malloc/free, while 2 never use malloc/free and 15 use regions somewhere in their codebases.
- Seven projects primarily use regions, five primarily use garbage collection, and three primarily use reference counting.
- SQLite allocates entirely manually, while cURL and Redis allocate mostly manually at 94% and 79%, respectively, with limited reference counting.
- Linux and QEMU have recently adopted compiler-extension-based scope cleanup, including Linux's __free(kfree) and QEMU's g_autofree.
- The analysis counts allocation call sites and excludes test code, third-party code, and examples, so it does not account for allocation sizes or sub-region usage.
#c #memory management #garbage collection #reference counting
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Hacker News: 3, latest observation
- Lobsters: 59, latest observation ; +57 over observed period since
Comments
Comment count reported by the source.
- Hacker News: 0, latest observation
- Lobsters: 14, latest observation ; +14 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Hacker News | 50520747 | https://theconsensus.dev/p/2026/11/08/c-memory-management-survey.html Read discussion |
| Lobsters | vdxevp | https://theconsensus.dev/p/2026/11/08/c-memory-management-survey.html Read discussion |