{"article":{"slug":"memory-management-in-40-major-c-projects-a-survey","title":"Memory management in 40 major C projects, a survey","subtitle":null,"summary":"Phil Eaton surveys how 40 major C projects allocate memory: only 8 use malloc/free alone, only 2 never use it, 15 use regions at some point, 7 primarily use regions, 5 primarily use garbage collection and 3 primarily use reference counting.","content_type":"research","language":"en","canonical_url":"https://theconsensus.dev/p/2026/11/08/c-memory-management-survey.html","author":{"name":"Phil Eaton","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"The Consensus","url":"https://theconsensus.dev/","listing_slug":null,"listing":null},"topics":[{"name":"c","slug":"c","url":"https://listedarticles.com/topics/c"},{"name":"systems-programming","slug":"systems-programming","url":"https://listedarticles.com/topics/systems-programming"},{"name":"programming-languages","slug":"programming-languages","url":"https://listedarticles.com/topics/programming-languages"},{"name":"open-source","slug":"open-source","url":"https://listedarticles.com/topics/open-source"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":1090,"reading_minutes":5,"published_at":"2026-11-08T00:00:00.000Z","added_at":"2026-11-15T13:52:41.701Z","updated_at":"2026-11-15T13:52:41.701Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/memory-management-in-40-major-c-projects-a-survey","markdown_url":"https://listedarticles.com/articles/memory-management-in-40-major-c-projects-a-survey.md","example":false,"citation":"Phil Eaton, The Consensus. \"Memory management in 40 major C projects, a survey.\" 8 Nov 2026. https://theconsensus.dev/p/2026/11/08/c-memory-management-survey.html (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://theconsensus.dev/p/2026/11/08/c-memory-management-survey.html"},"body_markdown":"November 8, 2026\n\n# Memory management in 40 major C projects, a survey\n\nA survey of 40 major C projects tracked by The Consensus shows only 8 projects allocate solely with malloc/free, only 2 projects allocate without ever using malloc/free, 15 projects make use of regions at some point, 7 projects primarily use regions to allocate, 5 primarily use garbage collection to allocate, and 3 primarily use reference counting to allocate.\n\n\n[Phil Eaton](https://theconsensus.dev/author/phil-eaton.html)Artwork by [Andrea Chersia](https://www.instagram.com/xinamito?utm_source=theconsensus.dev&utm_medium=referral) [Focus](https://theconsensus.dev/?focus=1 \"Hide the sidebar and widen code and tables\")\n\n\nC is well known for requiring manual memory management with malloc and free. And while many major projects do actually manage memory like this, many projects also implement higher-level memory management primitives such as regions (where objects allocated within a region need not be manually freed, freeing a region frees all objects allocated within the region at once), reference counting (manually incrementing and decrementing outstanding references, freeing an object only when its references go to zero), scope-based cleanup using compiler extensions, and a number of major C projects even actually implement garbage collection (fully automatic memory management).\n\nProgrammers sometimes assume that projects famous for diligence lean away from purely manual memory management. But [SQLite](https://theconsensus.dev/project/sqlite.html), famous for correctness, allocates 100% manually while [cURL](https://theconsensus.dev/project/curl.html) and [Redis](https://theconsensus.dev/project/redis.html) allocate mostly manually (94% and 79%), reference counting only some of their objects. Another surprising finding is that [Linux](https://theconsensus.dev/project/linux.html) and [QEMU](https://theconsensus.dev/project/qemu.html) in the last few years have been starting to use scope cleanup rules (i.e. compiler extensions) to automatically clean up memory, such as Linux's [`__free(kfree)`](https://github.com/torvalds/linux/blob/v7.2/drivers/input/touchscreen/raydium_i2c_ts.c?utm_source=theconsensus.dev&utm_medium=referral#L174) and QEMU's [`g_autofree`](https://github.com/qemu/qemu/blob/v11.1.2/block.c?utm_source=theconsensus.dev&utm_medium=referral#L855).\n\nThe Consensus tracks and indexes code for over 400 major software infrastructure [projects](https://theconsensus.dev/projects.html). This article surveys 40 of the C projects within this group, excluding test code, third-party code, and examples.\n\n## Majority allocation strategy[#](#majority-allocation-strategy)\n\nTo discover majority allocation we count allocation call sites (which is certainly a limited metric, not accounting for sub-region or size of allocation, etc.). [seL4](https://theconsensus.dev/project/sel4.html) is an exception to much of this article since it has no heap at all.\n\n8 projects solely allocate with malloc, implementing no other general higher-level strategy for allocating. These projects are: [brotli](https://theconsensus.dev/project/brotli.html), [FreeRTOS](https://theconsensus.dev/project/freertos.html), [HAProxy](https://theconsensus.dev/project/haproxy.html), [libdeflate](https://theconsensus.dev/project/libdeflate.html), [lz4](https://theconsensus.dev/project/lz4.html), [SQLite](https://theconsensus.dev/project/sqlite.html), [xz-utils](https://theconsensus.dev/project/xz-utils.html), and [zlib](https://theconsensus.dev/project/zlib.html).\n\n16 projects primarily, but not exclusively, allocate with malloc.\n\n| Project | Manual % | Region % | Garbage Collector % | Reference Counting % |\n| --- | --- | --- | --- | --- |\n| [PgBouncer](https://theconsensus.dev/project/pgbouncer.html) | 98 | 0 | 0 | 2 |\n| [tmux](https://theconsensus.dev/project/tmux.html) | 98 | 0 | 0 | 2 |\n| [git](https://theconsensus.dev/project/git.html) | 96 | 3 | 0 | 0 |\n| [curl](https://theconsensus.dev/project/curl.html) | 94 | 0 | 0 | 6 |\n| [dqlite](https://theconsensus.dev/project/dqlite.html) | 92 | 0 | 0 | 8 |\n| [QEMU](https://theconsensus.dev/project/qemu.html) | 86 | 0 | 0 | 14 |\n| [Vim](https://theconsensus.dev/project/vim.html) | 85 | 0 | 0 | 15 |\n| [Redis](https://theconsensus.dev/project/redis.html) | 79 | 0 | 0 | 21 |\n| [Neovim](https://theconsensus.dev/project/neovim.html) | 74 | 10 | 0 | 15 |\n| [universal-ctags](https://theconsensus.dev/project/universal-ctags.html) | 72 | 0 | 0 | 28 |\n| [Linux](https://theconsensus.dev/project/linux.html) | 71 | 29 | 0 | 0 |\n| [zstd](https://theconsensus.dev/project/zstandard.html) | 70 | 30 | 0 | 0 |\n| [tree-sitter](https://theconsensus.dev/project/tree-sitter.html) | 62 | 0 | 0 | 38 |\n| [Erlang](https://theconsensus.dev/project/erlang.html) | 57 | 0 | 39 | 4 |\n| [PostGIS](https://theconsensus.dev/project/postgis.html) | 54 | 46 | 0 | 1 |\n| [Xen](https://theconsensus.dev/project/xen.html) | 51 | 49 | 0 | 0 |\n\n7 projects primarily, if not all exclusively, allocate with a region system. With region based allocators, objects are allocated within a region. Freeing the region frees all objects within the region. Sometiems regions can be nested. And sometimes you might still manually free an object allocated within a region.\n\n| Project | Region % | Manual % | Garbage Collector % |\n| --- | --- | --- | --- |\n| [pgvector](https://theconsensus.dev/project/pgvector.html) | 100 | 0 | 0 |\n| [TimescaleDB](https://theconsensus.dev/project/timescaledb.html) | 100 | 0 | 0 |\n| [Citus](https://theconsensus.dev/project/citus.html) | 99 | 1 | 0 |\n| [httpd](https://theconsensus.dev/project/apache-http-server.html) | 98 | 2 | 0 |\n| [nginx](https://theconsensus.dev/project/nginx.html) | 92 | 8 | 0 |\n| [Postgres](https://theconsensus.dev/project/postgresql.html) | 78 | 22 | 0 |\n| [llama.cpp (ggml)](https://theconsensus.dev/project/llama-cpp.html) | 65 | 35 | 0 |\n\nAnd 5 projects primarily allocate with a garbage collector.\n\n| Project | Garbage Collector % | Manual % | Region % |\n| --- | --- | --- | --- |\n| [Ruby](https://theconsensus.dev/project/ruby.html) | 82 | 18 | 0 |\n| [Julia](https://theconsensus.dev/project/julia.html) | 80 | 20 | 0 |\n| [Emacs](https://theconsensus.dev/project/emacs.html) | 77 | 23 | 0 |\n| [OCaml](https://theconsensus.dev/project/ocaml.html) | 62 | 38 | 0 |\n| [Lua](https://theconsensus.dev/project/lua.html) | 60 | 40 | 0 |\n\n3 projects primarily allocate reference-counted objects.\n\n| Project | Reference Counting % | Manual % | Region % |\n| --- | --- | --- | --- |\n| [CPython](https://theconsensus.dev/project/python.html) | 85 | 13 | 2 |\n| [PHP](https://theconsensus.dev/project/php.html) | 62 | 36 | 2 |\n| [Perl](https://theconsensus.dev/project/perl.html) | 62 | 38 | 0 |\n\n## All projects[#](#all-projects)\n\nAcross all surveyed projects, with links to their various allocation strategies by example.\n\n| Project | free/malloc | Region | Garbage Collector | Reference Counts | Scope Cleanup |\n| --- | --- | --- | --- | --- | --- |\n| [sqlite](https://theconsensus.dev/project/sqlite.html) | [`sqlite3_mprintf`](https://github.com/sqlite/sqlite/blob/version-3.53.4/src/memdb.c?utm_source=theconsensus.dev&utm_medium=referral#L794), [`sqlite3_free`](https://github.com/sqlite/sqlite/blob/version-3.53.4/src/memdb.c?utm_source=theconsensus.dev&utm_medium=referral#L796) | none | none | none | none |\n| [haproxy](https://theconsensus.dev/project/haproxy.html) | [`strdup`](https://github.com/haproxy/haproxy/blob/v3.4.0/src/mux_h1.c?utm_source=theconsensus.dev&utm_medium=referral#L5745), [`free`](https://github.com/haproxy/haproxy/blob/v3.4.0/src/mux_h1.c?utm_source=theconsensus.dev&utm_medium=referral#L5748) | none | none | none | none |\n| [pgbouncer](https://theconsensus.dev/project/pgbouncer.html) | [`malloc`](https://github.com/pgbouncer/pgbouncer/blob/pgbouncer_1_26_0/src/scram.c?utm_source=theconsensus.dev&utm_medium=referral#L214), [`free`](https://github.com/pgbouncer/pgbouncer/blob/pgbouncer_1_26_0/src/scram.c?utm_source=theconsensus.dev&utm_medium=referral#L218) | none | none | [`strpool_decref`](https://github.com/pgbouncer/pgbouncer/blob/pgbouncer_1_26_0/src/varcache.c?utm_source=theconsensus.dev&utm_medium=referral#L148) | none |\n| [redis](https://theconsensus.dev/project/redis.html) | [`zmalloc`](https://github.com/redis/redis/blob/8.10.1/src/networking.c?utm_source=theconsensus.dev&utm_medium=referral#L123), [`zfree`](https://github.com/redis/redis/blob/8.10.1/src/networking.c?utm_source=theconsensus.dev&utm_medium=referral#L2378) | none | none | [`decrRefCount`](https://github.com/redis/redis/blob/8.10.1/src/acl.c?utm_source=theconsensus.dev&utm_medium=referral#L472) | none |\n| [git](https://theconsensus.dev/project/git.html) | [`xstrdup`](https://github.com/git/git/blob/v2.56.0/builtin/update-index.c?utm_source=theconsensus.dev&utm_medium=referral#L718), [`free`](https://github.com/git/git/blob/v2.56.0/builtin/update-index.c?utm_source=theconsensus.dev&utm_medium=referral#L720) | [`mem_pool_alloc`](https://github.com/git/git/blob/v2.56.0/diff.c?utm_source=theconsensus.dev&utm_medium=referral#L1093), [`mem_pool_init`](https://github.com/git/git/blob/v2.56.0/diff.c?utm_source=theconsensus.dev&utm_medium=referral#L1068) | none | [`blame_origin_decref`](https://github.com/git/git/blob/v2.56.0/blame.c?utm_source=theconsensus.dev&utm_medium=referral#L1485) | none |\n| [tmux](https://theconsensus.dev/project/tmux.html) | [`xstrdup`](https://github.com/tmux/tmux/blob/3.8/cmd-display-menu.c?utm_source=theconsensus.dev&utm_medium=referral#L505), [`free`](https://github.com/tmux/tmux/blob/3.8/cmd-display-menu.c?utm_source=theconsensus.dev&utm_medium=referral#L507) | none | none | [`server_client_unref`](https://github.com/tmux/tmux/blob/3.8/cmd-if-shell.c?utm_source=theconsensus.dev&utm_medium=referral#L186) | none |\n| [vim](https://theconsensus.dev/project/vim.html) | [`vim_strsave`](https://github.com/vim/vim/blob/v9.2.1167/src/clientserver.c?utm_source=theconsensus.dev&utm_medium=referral#L968), [`vim_free`](https://github.com/vim/vim/blob/v9.2.1167/src/clientserver.c?utm_source=theconsensus.dev&utm_medium=referral#L970) | none | [`garbage_collect`](https://github.com/vim/vim/blob/v9.2.1167/src/eval.c?utm_source=theconsensus.dev&utm_medium=referral#L112) | [`dict_unref`](https://github.com/vim/vim/blob/v9.2.1167/src/dict.c?utm_source=theconsensus.dev&utm_medium=referral#L351) | none |\n| [neovim](https://theconsensus.dev/project/neovim.html) | [`xstrdup`](https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/normal.c?utm_source=theconsensus.dev&utm_medium=referral#L696), [`xfree`](https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/normal.c?utm_source=theconsensus.dev&utm_medium=referral#L698) | [`arena_memdupz`](https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/highlight_group.c?utm_source=theconsensus.dev&utm_medium=referral#L2087), [`arena_mem_free`](https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/highlight_group.c?utm_source=theconsensus.dev&utm_medium=referral#L1528) | none | [`tv_dict_unref`](https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/eval.c?utm_source=theconsensus.dev&utm_medium=referral#L3831) | none |\n| [tree-sitter](https://theconsensus.dev/project/tree-sitter.html) | [`ts_malloc`](https://github.com/tree-sitter/tree-sitter/blob/v0.27.1/lib/src/stack.c?utm_source=theconsensus.dev&utm_medium=referral#L626), [`ts_free`](https://github.com/tree-sitter/tree-sitter/blob/v0.27.1/lib/src/stack.c?utm_source=theconsensus.dev&utm_medium=referral#L634) | none | none | [`ts_subtree_release`](https://github.com/tree-sitter/tree-sitter/blob/v0.27.1/lib/src/parser.c?utm_source=theconsensus.dev&utm_medium=referral#L213) | none |\n| [universal-ctags](https://theconsensus.dev/project/universal-ctags.html) | [`eStrdup`](https://github.com/universal-ctags/ctags/blob/v6.2.1/main/parse.c?utm_source=theconsensus.dev&utm_medium=referral#L2405), [`eFree`](https://github.com/universal-ctags/ctags/blob/v6.2.1/main/parse.c?utm_source=theconsensus.dev&utm_medium=referral#L2411) | none | none | [`es_object_unref`](https://github.com/universal-ctags/ctags/blob/v6.2.1/main/field.c?utm_source=theconsensus.dev&utm_medium=referral#L1638) | none |\n| [zstandard](https://theconsensus.dev/project/zstandard.html) | [`malloc`](https://github.com/facebook/zstd/blob/v1.5.7/lib/dictBuilder/cover.c?utm_source=theconsensus.dev&utm_medium=referral#L1028), [`free`](https://github.com/facebook/zstd/blob/v1.5.7/lib/dictBuilder/cover.c?utm_source=theconsensus.dev&utm_medium=referral#L1033) | [`ZSTD_cwksp_reserve_aligned64`](https://github.com/facebook/zstd/blob/v1.5.7/lib/compress/zstd_compress.c?utm_source=theconsensus.dev&utm_medium=referral#L2042), [`ZSTD_cwksp_init`](https://github.com/facebook/zstd/blob/v1.5.7/lib/compress/zstd_compress.c?utm_source=theconsensus.dev&utm_medium=referral#L132) | none | none | none |\n| [zlib](https://theconsensus.dev/project/zlib.html) | [`ZALLOC`](https://github.com/madler/zlib/blob/v1.3.2/deflate.c?utm_source=theconsensus.dev&utm_medium=referral#L440), [`ZFREE`](https://github.com/madler/zlib/blob/v1.3.2/deflate.c?utm_source=theconsensus.dev&utm_medium=referral#L1306) | none | none | none | none |\n| [xz-utils](https://theconsensus.dev/project/xz-utils.html) | [`lzma_alloc`](https://github.com/tukaani-project/xz/blob/v5.8.4/src/liblzma/common/string_conversion.c?utm_source=theconsensus.dev&utm_medium=referral#L919), [`lzma_free`](https://github.com/tukaani-project/xz/blob/v5.8.4/src/liblzma/common/string_conversion.c?utm_source=theconsensus.dev&utm_medium=referral#L924) | none | none | none | none |\n| [lz4](https://theconsensus.dev/project/lz4.html) | [`ALLOC`](https://github.com/lz4/lz4/blob/v1.10.0/lib/lz4.c?utm_source=theconsensus.dev&utm_medium=referral#L1457), [`FREEMEM`](https://github.com/lz4/lz4/blob/v1.10.0/lib/lz4.c?utm_source=theconsensus.dev&utm_medium=referral#L1466) | none | none | none | none |\n| [brotli](https://theconsensus.dev/project/brotli.html) | [`BROTLI_ALLOC`](https://github.com/google/brotli/blob/v1.2.0/c/enc/backward_references_hq.c?utm_source=theconsensus.dev&utm_medium=referral#L106), [`BROTLI_FREE`](https://github.com/google/brotli/blob/v1.2.0/c/enc/backward_references_hq.c?utm_source=theconsensus.dev&utm_medium=referral#L113) | none | none | none | none |\n| [libdeflate](https://theconsensus.dev/project/libdeflate.html) | [`libdeflate_aligned_malloc`](https://github.com/ebiggers/libdeflate/blob/v1.26/lib/deflate_compress.c?utm_source=theconsensus.dev&utm_medium=referral#L3910), [`libdeflate_aligned_free`](https://github.com/ebiggers/libdeflate/blob/v1.26/lib/deflate_compress.c?utm_source=theconsensus.dev&utm_medium=referral#L4078) | none | none | none | none |\n| [freertos](https://theconsensus.dev/project/freertos.html) | [`pvPortMalloc`](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/V11.3.3/tasks.c?utm_source=theconsensus.dev&utm_medium=referral#L1651), [`vPortFree`](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/V11.3.3/tasks.c?utm_source=theconsensus.dev&utm_medium=referral#L1668) | none | none | none | none |\n| [dqlite](https://theconsensus.dev/project/dqlite.html) | [`raft_malloc`](https://github.com/canonical/dqlite/blob/v1.18.7/src/gateway.c?utm_source=theconsensus.dev&utm_medium=referral#L330), [`raft_free`](https://github.com/canonical/dqlite/blob/v1.18.7/src/gateway.c?utm_source=theconsensus.dev&utm_medium=referral#L338) | none | none | [`logRelease`](https://github.com/canonical/dqlite/blob/v1.18.7/src/raft/replication.c?utm_source=theconsensus.dev&utm_medium=referral#L53) | none |\n| [curl](https://theconsensus.dev/project/curl.html) | [`curlx_calloc`](https://github.com/curl/curl/blob/curl-8_23_0/lib/select.c?utm_source=theconsensus.dev&utm_medium=referral#L593), [`curlx_free`](https://github.com/curl/curl/blob/curl-8_23_0/lib/select.c?utm_source=theconsensus.dev&utm_medium=referral#L598) | none | none | [`Curl_creds_unlink`](https://github.com/curl/curl/blob/curl-8_23_0/lib/creds.c?utm_source=theconsensus.dev&utm_medium=referral#L100) | none |\n| [xen](https://theconsensus.dev/project/xen.html) | [`xzalloc`](https://github.com/xen-project/xen/blob/RELEASE-4.22.0/xen/common/vm_event.c?utm_source=theconsensus.dev&utm_medium=referral#L67), [`xfree`](https://github.com/xen-project/xen/blob/RELEASE-4.22.0/xen/common/vm_event.c?utm_source=theconsensus.dev&utm_medium=referral#L103) | [`GCSPRINTF`](https://github.com/xen-project/xen/blob/RELEASE-4.22.0/tools/libs/light/libxl_vtpm.c?utm_source=theconsensus.dev&utm_medium=referral#L43), [`GC_INIT`](https://github.com/xen-project/xen/blob/RELEASE-4.22.0/tools/libs/light/libxl_vtpm.c?utm_source=theconsensus.dev&utm_medium=referral#L96) | none | none | none |\n| [qemu](https://theconsensus.dev/project/qemu.html) | [`g_new0`](https://github.com/qemu/qemu/blob/v11.1.2/migration/multifd-qpl.c?utm_source=theconsensus.dev&utm_medium=referral#L190), [`g_free`](https://github.com/qemu/qemu/blob/v11.1.2/migration/multifd-qpl.c?utm_source=theconsensus.dev&utm_medium=referral#L193) | none | none | [`object_unref`](https://github.com/qemu/qemu/blob/v11.1.2/blockdev-nbd.c?utm_source=theconsensus.dev&utm_medium=referral#L65) | [`g_autofree`](https://github.com/qemu/qemu/blob/v11.1.2/block.c?utm_source=theconsensus.dev&utm_medium=referral#L855) |\n| [linux](https://theconsensus.dev/project/linux.html) | [`kzalloc_obj`](https://github.com/torvalds/linux/blob/v7.2/fs/binfmt_elf.c?utm_source=theconsensus.dev&utm_medium=referral#L1801), [`kfree`](https://github.com/torvalds/linux/blob/v7.2/fs/binfmt_elf.c?utm_source=theconsensus.dev&utm_medium=referral#L1803) | [`devm_kzalloc`](https://github.com/torvalds/linux/blob/v7.2/drivers/input/touchscreen/raydium_i2c_ts.c?utm_source=theconsensus.dev&utm_medium=referral#L1069) | none | [`kref_put`](https://github.com/torvalds/linux/blob/v7.2/drivers/base/core.c?utm_source=theconsensus.dev&utm_medium=referral#L1305) | [`__free`](https://github.com/torvalds/linux/blob/v7.2/drivers/input/touchscreen/raydium_i2c_ts.c?utm_source=theconsensus.dev&utm_medium=referral#L174) |\n| [postgresql](https://theconsensus.dev/project/postgresql.html) | [`pg_strdup`](https://github.com/postgres/postgres/blob/REL_18_6/src/bin/pg_dump/dumputils.c?utm_source=theconsensus.dev&utm_medium=referral#L766), [`pg_free`](https://github.com/postgres/postgres/blob/REL_18_6/src/bin/pg_dump/dumputils.c?utm_source=theconsensus.dev&utm_medium=referral#L770) | [`palloc`](https://github.com/postgres/postgres/blob/REL_18_6/src/backend/foreign/foreign.c?utm_source=theconsensus.dev&utm_medium=referral#L69), [`MemoryContextReset`](https://github.com/postgres/postgres/blob/REL_18_6/src/backend/tcop/postgres.c?utm_source=theconsensus.dev&utm_medium=referral#L4543) | none | none | none |\n| [pgvector](https://theconsensus.dev/project/pgvector.html) | none | [`palloc`](https://github.com/pgvector/pgvector/blob/v0.8.6/src/vector.c?utm_source=theconsensus.dev&utm_medium=referral#L308), [`MemoryContextDelete`](https://github.com/pgvector/pgvector/blob/v0.8.6/src/ivfinsert.c?utm_source=theconsensus.dev&utm_medium=referral#L216) | none | none | none |\n| [citus](https://theconsensus.dev/project/citus.html) | [`strdup`](https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/connection/connection_configuration.c?utm_source=theconsensus.dev&utm_medium=referral#L130), [`free`](https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/connection/connection_configuration.c?utm_source=theconsensus.dev&utm_medium=referral#L100) | [`palloc0`](https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/shardsplit/shardsplit_shared_memory.c?utm_source=theconsensus.dev&utm_medium=referral#L359), [`MemoryContextReset`](https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/connection/connection_management.c?utm_source=theconsensus.dev&utm_medium=referral#L1034) | none | none | none |\n| [timescaledb](https://theconsensus.dev/project/timescaledb.html) | none | [`palloc`](https://github.com/timescale/timescaledb/blob/2.30.0/src/constraint.c?utm_source=theconsensus.dev&utm_medium=referral#L119), [`AllocSetContextCreate`](https://github.com/timescale/timescaledb/blob/2.30.0/src/hypertable_cache.c?utm_source=theconsensus.dev&utm_medium=referral#L62) | none | none | none |\n| [postgis](https://theconsensus.dev/project/postgis.html) | [`lwalloc`](https://github.com/postgis/postgis/blob/3.6.4/liblwgeom/gserialized1.c?utm_source=theconsensus.dev&utm_medium=referral#L240), [`lwfree`](https://github.com/postgis/postgis/blob/3.6.4/liblwgeom/gserialized1.c?utm_source=theconsensus.dev&utm_medium=referral#L247) | [`palloc`](https://github.com/postgis/postgis/blob/3.6.4/libpgcommon/shared_gserialized.c?utm_source=theconsensus.dev&utm_medium=referral#L30), [`AllocSetContextCreate`](https://github.com/postgis/postgis/blob/3.6.4/libpgcommon/lwgeom_pg.c?utm_source=theconsensus.dev&utm_medium=referral#L172) | none | [`shared_gserialized_unref`](https://github.com/postgis/postgis/blob/3.6.4/libpgcommon/lwgeom_cache.c?utm_source=theconsensus.dev&utm_medium=referral#L183) | none |\n| [nginx](https://theconsensus.dev/project/nginx.html) | [`ngx_alloc`](https://github.com/nginx/nginx/blob/release-1.31.6/src/http/v3/ngx_http_v3_table.c?utm_source=theconsensus.dev&utm_medium=referral#L337), [`ngx_free`](https://github.com/nginx/nginx/blob/release-1.31.6/src/http/v3/ngx_http_v3_table.c?utm_source=theconsensus.dev&utm_medium=referral#L344) | [`ngx_create_pool`](https://github.com/nginx/nginx/blob/release-1.31.6/src/http/ngx_http_request.c?utm_source=theconsensus.dev&utm_medium=referral#L584), [`ngx_destroy_pool`](https://github.com/nginx/nginx/blob/release-1.31.6/src/http/ngx_http_request.c?utm_source=theconsensus.dev&utm_medium=referral#L591) | none | none | none |\n| [apache-http-server](https://theconsensus.dev/project/apache-http-server.html) | [`apr_bucket_alloc`](https://github.com/apache/httpd/blob/2.4.69/modules/generators/cgi_common.h?utm_source=theconsensus.dev&utm_medium=referral#L318), [`apr_bucket_free`](https://github.com/apache/httpd/blob/2.4.69/modules/generators/cgi_common.h?utm_source=theconsensus.dev&utm_medium=referral#L323) | [`apr_pool_create`](https://github.com/apache/httpd/blob/2.4.69/server/mpm/prefork/prefork.c?utm_source=theconsensus.dev&utm_medium=referral#L448), [`apr_pool_clear`](https://github.com/apache/httpd/blob/2.4.69/server/mpm/prefork/prefork.c?utm_source=theconsensus.dev&utm_medium=referral#L559) | none | none | none |\n| [llama-cpp (ggml C)](https://theconsensus.dev/project/llama-cpp.html) | [`calloc`](https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml-alloc.c?utm_source=theconsensus.dev&utm_medium=referral#L164), [`free`](https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml-alloc.c?utm_source=theconsensus.dev&utm_medium=referral#L354) | [`ggml_new_tensor_1d`](https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml.c?utm_source=theconsensus.dev&utm_medium=referral#L2489), [`ggml_free`](https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml-cpu/ggml-cpu.c?utm_source=theconsensus.dev&utm_medium=referral#L3864) | none | none | none |\n| [python](https://theconsensus.dev/project/python.html) | [`PyMem_Malloc`](https://github.com/python/cpython/blob/v3.14.7/Objects/memoryobject.c?utm_source=theconsensus.dev&utm_medium=referral#L3241), [`PyMem_Free`](https://github.com/python/cpython/blob/v3.14.7/Objects/memoryobject.c?utm_source=theconsensus.dev&utm_medium=referral#L3247) | [`_PyArena_New`](https://github.com/python/cpython/blob/v3.14.7/Python/pythonrun.c?utm_source=theconsensus.dev&utm_medium=referral#L314), [`_PyArena_Free`](https://github.com/python/cpython/blob/v3.14.7/Python/pythonrun.c?utm_source=theconsensus.dev&utm_medium=referral#L323) | [`PyObject_GC_New`](https://github.com/python/cpython/blob/v3.14.7/Modules/_asynciomodule.c?utm_source=theconsensus.dev&utm_medium=referral#L2058) | [`Py_DECREF`](https://github.com/python/cpython/blob/v3.14.7/Objects/listobject.c?utm_source=theconsensus.dev&utm_medium=referral#L256) | none |\n| [php](https://theconsensus.dev/project/php.html) | [`emalloc`](https://github.com/php/php-src/blob/php-8.5.10/ext/ffi/ffi.c?utm_source=theconsensus.dev&utm_medium=referral#L3031), [`efree`](https://github.com/php/php-src/blob/php-8.5.10/ext/ffi/ffi.c?utm_source=theconsensus.dev&utm_medium=referral#L3033) | [`zend_arena_alloc`](https://github.com/php/php-src/blob/php-8.5.10/sapi/phpdbg/phpdbg_print.c?utm_source=theconsensus.dev&utm_medium=referral#L370), [`zend_arena_release`](https://github.com/php/php-src/blob/php-8.5.10/ext/opcache/ZendAccelerator.c?utm_source=theconsensus.dev&utm_medium=referral#L4108) | [`gc_collect_cycles`](https://github.com/php/php-src/blob/php-8.5.10/Zend/zend_execute_API.c?utm_source=theconsensus.dev&utm_medium=referral#L423) | [`zend_string_release`](https://github.com/php/php-src/blob/php-8.5.10/Zend/zend.c?utm_source=theconsensus.dev&utm_medium=referral#L1637) | none |\n| [perl](https://theconsensus.dev/project/perl.html) | [`Newx`](https://github.com/Perl/perl5/blob/v5.44.0/av.c?utm_source=theconsensus.dev&utm_medium=referral#L172), [`Safefree`](https://github.com/Perl/perl5/blob/v5.44.0/av.c?utm_source=theconsensus.dev&utm_medium=referral#L174) | none | none | [`SvREFCNT_dec`](https://github.com/Perl/perl5/blob/v5.44.0/av.c?utm_source=theconsensus.dev&utm_medium=referral#L383) | [`sv_2mortal`](https://github.com/Perl/perl5/blob/v5.44.0/pp_hot.c?utm_source=theconsensus.dev&utm_medium=referral#L6867) |\n| [lua](https://theconsensus.dev/project/lua.html) | [`luaM_growvector`](https://github.com/lua/lua/blob/v5.5.1/lparser.c?utm_source=theconsensus.dev&utm_medium=referral#L179), [`luaM_freearray`](https://github.com/lua/lua/blob/v5.5.1/ldo.c?utm_source=theconsensus.dev&utm_medium=referral#L1185) | none | [`luaS_new`](https://github.com/lua/lua/blob/v5.5.1/lapi.c?utm_source=theconsensus.dev&utm_medium=referral#L546) | none | none |\n| [ruby](https://theconsensus.dev/project/ruby.html) | [`xmalloc`](https://github.com/ruby/ruby/blob/v4.0.6/prism_compile.c?utm_source=theconsensus.dev&utm_medium=referral#L11237), [`xfree`](https://github.com/ruby/ruby/blob/v4.0.6/prism_compile.c?utm_source=theconsensus.dev&utm_medium=referral#L11239) | none | [`TypedData_Make_Struct`](https://github.com/ruby/ruby/blob/v4.0.6/ast.c?utm_source=theconsensus.dev&utm_medium=referral#L286) | none | none |\n| [emacs](https://theconsensus.dev/project/emacs.html) | [`xmalloc`](https://github.com/emacs-mirror/emacs/blob/emacs-31.1/src/sysdep.c?utm_source=theconsensus.dev&utm_medium=referral#L3369), [`xfree`](https://github.com/emacs-mirror/emacs/blob/emacs-31.1/src/sysdep.c?utm_source=theconsensus.dev&utm_medium=referral#L3372) | none | [`Fcons`](https://github.com/emacs-mirror/emacs/blob/emacs-31.1/src/alloc.c?utm_source=theconsensus.dev&utm_medium=referral#L2641) | none | none |\n| [ocaml](https://theconsensus.dev/project/ocaml.html) | [`caml_stat_alloc`](https://github.com/ocaml/ocaml/blob/5.5.1/runtime/win32.c?utm_source=theconsensus.dev&utm_medium=referral#L679), [`caml_stat_free`](https://github.com/ocaml/ocaml/blob/5.5.1/runtime/win32.c?utm_source=theconsensus.dev&utm_medium=referral#L681) | none | [`caml_copy_double`](https://github.com/ocaml/ocaml/blob/5.5.1/runtime/bigarray.c?utm_source=theconsensus.dev&utm_medium=referral#L726) | none | none |\n| [erlang](https://theconsensus.dev/project/erlang.html) | [`erts_alloc`](https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/erl_thr_progress.c?utm_source=theconsensus.dev&utm_medium=referral#L337), [`erts_free`](https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/erl_thr_progress.c?utm_source=theconsensus.dev&utm_medium=referral#L355) | none | [`HAlloc`](https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/beam_bif_load.c?utm_source=theconsensus.dev&utm_medium=referral#L257) | [`erts_bin_release`](https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/beam_load.c?utm_source=theconsensus.dev&utm_medium=referral#L698) | none |\n| [julia](https://theconsensus.dev/project/julia.html) | [`malloc_s`](https://github.com/JuliaLang/julia/blob/v1.12.7/src/sys.c?utm_source=theconsensus.dev&utm_medium=referral#L656), [`free`](https://github.com/JuliaLang/julia/blob/v1.12.7/src/sys.c?utm_source=theconsensus.dev&utm_medium=referral#L659) | none | [`jl_gc_alloc`](https://github.com/JuliaLang/julia/blob/v1.12.7/src/array.c?utm_source=theconsensus.dev&utm_medium=referral#L64) | none | none |\n| [sel4](https://theconsensus.dev/project/sel4.html) | none | none | none | none | none |\n\n\nGet new deep dives like this one, plus new jobs and funding news in software infrastructure, free in your inbox every week.\n\n\n[Phil Eaton](https://theconsensus.dev/author/phil-eaton.html)\n\nPhil is the founder of The Consensus. Before this, he was a staff engineer on a distributed Postgres product at EnterpriseDB, cofounded and led marketing at TigerBeetle, and was an engineering manager at Oracle. He runs the Software Internals Discord and the Software Internals Email Book Club. [@eatonphil](https://twitter.com/eatonphil?utm_source=theconsensus.dev&utm_medium=referral)\n\n\n","body_html":"<p>November 8, 2026</p>\n<h1 id=\"memory-management-in-40-major-c-projects-a-survey\">Memory management in 40 major C projects, a survey</h1>\n<p>A survey of 40 major C projects tracked by The Consensus shows only 8 projects allocate solely with malloc/free, only 2 projects allocate without ever using malloc/free, 15 projects make use of regions at some point, 7 projects primarily use regions to allocate, 5 primarily use garbage collection to allocate, and 3 primarily use reference counting to allocate.</p>\n<p><a href=\"https://theconsensus.dev/author/phil-eaton.html\" rel=\"nofollow ugc noopener\">Phil Eaton</a>Artwork by <a href=\"https://www.instagram.com/xinamito?utm_source=theconsensus.dev&amp;utm_medium=referral\" rel=\"nofollow ugc noopener\">Andrea Chersia</a> <a href=\"https://theconsensus.dev/?focus=1\" title=\"Hide the sidebar and widen code and tables\" rel=\"nofollow ugc noopener\">Focus</a></p>\n<p>C is well known for requiring manual memory management with malloc and free. And while many major projects do actually manage memory like this, many projects also implement higher-level memory management primitives such as regions (where objects allocated within a region need not be manually freed, freeing a region frees all objects allocated within the region at once), reference counting (manually incrementing and decrementing outstanding references, freeing an object only when its references go to zero), scope-based cleanup using compiler extensions, and a number of major C projects even actually implement garbage collection (fully automatic memory management).</p>\n<p>Programmers sometimes assume that projects famous for diligence lean away from purely manual memory management. But <a href=\"https://theconsensus.dev/project/sqlite.html\" rel=\"nofollow ugc noopener\">SQLite</a>, famous for correctness, allocates 100% manually while <a href=\"https://theconsensus.dev/project/curl.html\" rel=\"nofollow ugc noopener\">cURL</a> and <a href=\"https://theconsensus.dev/project/redis.html\" rel=\"nofollow ugc noopener\">Redis</a> allocate mostly manually (94% and 79%), reference counting only some of their objects. Another surprising finding is that <a href=\"https://theconsensus.dev/project/linux.html\" rel=\"nofollow ugc noopener\">Linux</a> and <a href=\"https://theconsensus.dev/project/qemu.html\" rel=\"nofollow ugc noopener\">QEMU</a> in the last few years have been starting to use scope cleanup rules (i.e. compiler extensions) to automatically clean up memory, such as Linux&#39;s <a href=\"https://github.com/torvalds/linux/blob/v7.2/drivers/input/touchscreen/raydium_i2c_ts.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L174\" rel=\"nofollow ugc noopener\"><code>__free(kfree)</code></a> and QEMU&#39;s <a href=\"https://github.com/qemu/qemu/blob/v11.1.2/block.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L855\" rel=\"nofollow ugc noopener\"><code>g_autofree</code></a>.</p>\n<p>The Consensus tracks and indexes code for over 400 major software infrastructure <a href=\"https://theconsensus.dev/projects.html\" rel=\"nofollow ugc noopener\">projects</a>. This article surveys 40 of the C projects within this group, excluding test code, third-party code, and examples.</p>\n<h2 id=\"majority-allocation-strategy\">Majority allocation strategy<a href=\"#majority-allocation-strategy\">#</a></h2>\n<p>To discover majority allocation we count allocation call sites (which is certainly a limited metric, not accounting for sub-region or size of allocation, etc.). <a href=\"https://theconsensus.dev/project/sel4.html\" rel=\"nofollow ugc noopener\">seL4</a> is an exception to much of this article since it has no heap at all.</p>\n<p>8 projects solely allocate with malloc, implementing no other general higher-level strategy for allocating. These projects are: <a href=\"https://theconsensus.dev/project/brotli.html\" rel=\"nofollow ugc noopener\">brotli</a>, <a href=\"https://theconsensus.dev/project/freertos.html\" rel=\"nofollow ugc noopener\">FreeRTOS</a>, <a href=\"https://theconsensus.dev/project/haproxy.html\" rel=\"nofollow ugc noopener\">HAProxy</a>, <a href=\"https://theconsensus.dev/project/libdeflate.html\" rel=\"nofollow ugc noopener\">libdeflate</a>, <a href=\"https://theconsensus.dev/project/lz4.html\" rel=\"nofollow ugc noopener\">lz4</a>, <a href=\"https://theconsensus.dev/project/sqlite.html\" rel=\"nofollow ugc noopener\">SQLite</a>, <a href=\"https://theconsensus.dev/project/xz-utils.html\" rel=\"nofollow ugc noopener\">xz-utils</a>, and <a href=\"https://theconsensus.dev/project/zlib.html\" rel=\"nofollow ugc noopener\">zlib</a>.</p>\n<p>16 projects primarily, but not exclusively, allocate with malloc.</p>\n<div class=\"table-wrap\"><table><thead><tr><th>Project</th><th>Manual %</th><th>Region %</th><th>Garbage Collector %</th><th>Reference Counting %</th></tr></thead><tbody><tr><td><a href=\"https://theconsensus.dev/project/pgbouncer.html\" rel=\"nofollow ugc noopener\">PgBouncer</a></td><td>98</td><td>0</td><td>0</td><td>2</td></tr><tr><td><a href=\"https://theconsensus.dev/project/tmux.html\" rel=\"nofollow ugc noopener\">tmux</a></td><td>98</td><td>0</td><td>0</td><td>2</td></tr><tr><td><a href=\"https://theconsensus.dev/project/git.html\" rel=\"nofollow ugc noopener\">git</a></td><td>96</td><td>3</td><td>0</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/curl.html\" rel=\"nofollow ugc noopener\">curl</a></td><td>94</td><td>0</td><td>0</td><td>6</td></tr><tr><td><a href=\"https://theconsensus.dev/project/dqlite.html\" rel=\"nofollow ugc noopener\">dqlite</a></td><td>92</td><td>0</td><td>0</td><td>8</td></tr><tr><td><a href=\"https://theconsensus.dev/project/qemu.html\" rel=\"nofollow ugc noopener\">QEMU</a></td><td>86</td><td>0</td><td>0</td><td>14</td></tr><tr><td><a href=\"https://theconsensus.dev/project/vim.html\" rel=\"nofollow ugc noopener\">Vim</a></td><td>85</td><td>0</td><td>0</td><td>15</td></tr><tr><td><a href=\"https://theconsensus.dev/project/redis.html\" rel=\"nofollow ugc noopener\">Redis</a></td><td>79</td><td>0</td><td>0</td><td>21</td></tr><tr><td><a href=\"https://theconsensus.dev/project/neovim.html\" rel=\"nofollow ugc noopener\">Neovim</a></td><td>74</td><td>10</td><td>0</td><td>15</td></tr><tr><td><a href=\"https://theconsensus.dev/project/universal-ctags.html\" rel=\"nofollow ugc noopener\">universal-ctags</a></td><td>72</td><td>0</td><td>0</td><td>28</td></tr><tr><td><a href=\"https://theconsensus.dev/project/linux.html\" rel=\"nofollow ugc noopener\">Linux</a></td><td>71</td><td>29</td><td>0</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/zstandard.html\" rel=\"nofollow ugc noopener\">zstd</a></td><td>70</td><td>30</td><td>0</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/tree-sitter.html\" rel=\"nofollow ugc noopener\">tree-sitter</a></td><td>62</td><td>0</td><td>0</td><td>38</td></tr><tr><td><a href=\"https://theconsensus.dev/project/erlang.html\" rel=\"nofollow ugc noopener\">Erlang</a></td><td>57</td><td>0</td><td>39</td><td>4</td></tr><tr><td><a href=\"https://theconsensus.dev/project/postgis.html\" rel=\"nofollow ugc noopener\">PostGIS</a></td><td>54</td><td>46</td><td>0</td><td>1</td></tr><tr><td><a href=\"https://theconsensus.dev/project/xen.html\" rel=\"nofollow ugc noopener\">Xen</a></td><td>51</td><td>49</td><td>0</td><td>0</td></tr></tbody></table></div>\n<p>7 projects primarily, if not all exclusively, allocate with a region system. With region based allocators, objects are allocated within a region. Freeing the region frees all objects within the region. Sometiems regions can be nested. And sometimes you might still manually free an object allocated within a region.</p>\n<div class=\"table-wrap\"><table><thead><tr><th>Project</th><th>Region %</th><th>Manual %</th><th>Garbage Collector %</th></tr></thead><tbody><tr><td><a href=\"https://theconsensus.dev/project/pgvector.html\" rel=\"nofollow ugc noopener\">pgvector</a></td><td>100</td><td>0</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/timescaledb.html\" rel=\"nofollow ugc noopener\">TimescaleDB</a></td><td>100</td><td>0</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/citus.html\" rel=\"nofollow ugc noopener\">Citus</a></td><td>99</td><td>1</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/apache-http-server.html\" rel=\"nofollow ugc noopener\">httpd</a></td><td>98</td><td>2</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/nginx.html\" rel=\"nofollow ugc noopener\">nginx</a></td><td>92</td><td>8</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/postgresql.html\" rel=\"nofollow ugc noopener\">Postgres</a></td><td>78</td><td>22</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/llama-cpp.html\" rel=\"nofollow ugc noopener\">llama.cpp (ggml)</a></td><td>65</td><td>35</td><td>0</td></tr></tbody></table></div>\n<p>And 5 projects primarily allocate with a garbage collector.</p>\n<div class=\"table-wrap\"><table><thead><tr><th>Project</th><th>Garbage Collector %</th><th>Manual %</th><th>Region %</th></tr></thead><tbody><tr><td><a href=\"https://theconsensus.dev/project/ruby.html\" rel=\"nofollow ugc noopener\">Ruby</a></td><td>82</td><td>18</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/julia.html\" rel=\"nofollow ugc noopener\">Julia</a></td><td>80</td><td>20</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/emacs.html\" rel=\"nofollow ugc noopener\">Emacs</a></td><td>77</td><td>23</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/ocaml.html\" rel=\"nofollow ugc noopener\">OCaml</a></td><td>62</td><td>38</td><td>0</td></tr><tr><td><a href=\"https://theconsensus.dev/project/lua.html\" rel=\"nofollow ugc noopener\">Lua</a></td><td>60</td><td>40</td><td>0</td></tr></tbody></table></div>\n<p>3 projects primarily allocate reference-counted objects.</p>\n<div class=\"table-wrap\"><table><thead><tr><th>Project</th><th>Reference Counting %</th><th>Manual %</th><th>Region %</th></tr></thead><tbody><tr><td><a href=\"https://theconsensus.dev/project/python.html\" rel=\"nofollow ugc noopener\">CPython</a></td><td>85</td><td>13</td><td>2</td></tr><tr><td><a href=\"https://theconsensus.dev/project/php.html\" rel=\"nofollow ugc noopener\">PHP</a></td><td>62</td><td>36</td><td>2</td></tr><tr><td><a href=\"https://theconsensus.dev/project/perl.html\" rel=\"nofollow ugc noopener\">Perl</a></td><td>62</td><td>38</td><td>0</td></tr></tbody></table></div>\n<h2 id=\"all-projects\">All projects<a href=\"#all-projects\">#</a></h2>\n<p>Across all surveyed projects, with links to their various allocation strategies by example.</p>\n<div class=\"table-wrap\"><table><thead><tr><th>Project</th><th>free/malloc</th><th>Region</th><th>Garbage Collector</th><th>Reference Counts</th><th>Scope Cleanup</th></tr></thead><tbody><tr><td><a href=\"https://theconsensus.dev/project/sqlite.html\" rel=\"nofollow ugc noopener\">sqlite</a></td><td><a href=\"https://github.com/sqlite/sqlite/blob/version-3.53.4/src/memdb.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L794\" rel=\"nofollow ugc noopener\"><code>sqlite3_mprintf</code></a>, <a href=\"https://github.com/sqlite/sqlite/blob/version-3.53.4/src/memdb.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L796\" rel=\"nofollow ugc noopener\"><code>sqlite3_free</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/haproxy.html\" rel=\"nofollow ugc noopener\">haproxy</a></td><td><a href=\"https://github.com/haproxy/haproxy/blob/v3.4.0/src/mux_h1.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L5745\" rel=\"nofollow ugc noopener\"><code>strdup</code></a>, <a href=\"https://github.com/haproxy/haproxy/blob/v3.4.0/src/mux_h1.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L5748\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/pgbouncer.html\" rel=\"nofollow ugc noopener\">pgbouncer</a></td><td><a href=\"https://github.com/pgbouncer/pgbouncer/blob/pgbouncer_1_26_0/src/scram.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L214\" rel=\"nofollow ugc noopener\"><code>malloc</code></a>, <a href=\"https://github.com/pgbouncer/pgbouncer/blob/pgbouncer_1_26_0/src/scram.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L218\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/pgbouncer/pgbouncer/blob/pgbouncer_1_26_0/src/varcache.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L148\" rel=\"nofollow ugc noopener\"><code>strpool_decref</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/redis.html\" rel=\"nofollow ugc noopener\">redis</a></td><td><a href=\"https://github.com/redis/redis/blob/8.10.1/src/networking.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L123\" rel=\"nofollow ugc noopener\"><code>zmalloc</code></a>, <a href=\"https://github.com/redis/redis/blob/8.10.1/src/networking.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2378\" rel=\"nofollow ugc noopener\"><code>zfree</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/redis/redis/blob/8.10.1/src/acl.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L472\" rel=\"nofollow ugc noopener\"><code>decrRefCount</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/git.html\" rel=\"nofollow ugc noopener\">git</a></td><td><a href=\"https://github.com/git/git/blob/v2.56.0/builtin/update-index.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L718\" rel=\"nofollow ugc noopener\"><code>xstrdup</code></a>, <a href=\"https://github.com/git/git/blob/v2.56.0/builtin/update-index.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L720\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td><a href=\"https://github.com/git/git/blob/v2.56.0/diff.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1093\" rel=\"nofollow ugc noopener\"><code>mem_pool_alloc</code></a>, <a href=\"https://github.com/git/git/blob/v2.56.0/diff.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1068\" rel=\"nofollow ugc noopener\"><code>mem_pool_init</code></a></td><td>none</td><td><a href=\"https://github.com/git/git/blob/v2.56.0/blame.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1485\" rel=\"nofollow ugc noopener\"><code>blame_origin_decref</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/tmux.html\" rel=\"nofollow ugc noopener\">tmux</a></td><td><a href=\"https://github.com/tmux/tmux/blob/3.8/cmd-display-menu.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L505\" rel=\"nofollow ugc noopener\"><code>xstrdup</code></a>, <a href=\"https://github.com/tmux/tmux/blob/3.8/cmd-display-menu.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L507\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/tmux/tmux/blob/3.8/cmd-if-shell.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L186\" rel=\"nofollow ugc noopener\"><code>server_client_unref</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/vim.html\" rel=\"nofollow ugc noopener\">vim</a></td><td><a href=\"https://github.com/vim/vim/blob/v9.2.1167/src/clientserver.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L968\" rel=\"nofollow ugc noopener\"><code>vim_strsave</code></a>, <a href=\"https://github.com/vim/vim/blob/v9.2.1167/src/clientserver.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L970\" rel=\"nofollow ugc noopener\"><code>vim_free</code></a></td><td>none</td><td><a href=\"https://github.com/vim/vim/blob/v9.2.1167/src/eval.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L112\" rel=\"nofollow ugc noopener\"><code>garbage_collect</code></a></td><td><a href=\"https://github.com/vim/vim/blob/v9.2.1167/src/dict.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L351\" rel=\"nofollow ugc noopener\"><code>dict_unref</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/neovim.html\" rel=\"nofollow ugc noopener\">neovim</a></td><td><a href=\"https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/normal.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L696\" rel=\"nofollow ugc noopener\"><code>xstrdup</code></a>, <a href=\"https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/normal.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L698\" rel=\"nofollow ugc noopener\"><code>xfree</code></a></td><td><a href=\"https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/highlight_group.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2087\" rel=\"nofollow ugc noopener\"><code>arena_memdupz</code></a>, <a href=\"https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/highlight_group.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1528\" rel=\"nofollow ugc noopener\"><code>arena_mem_free</code></a></td><td>none</td><td><a href=\"https://github.com/neovim/neovim/blob/v0.12.5/src/nvim/eval.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3831\" rel=\"nofollow ugc noopener\"><code>tv_dict_unref</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/tree-sitter.html\" rel=\"nofollow ugc noopener\">tree-sitter</a></td><td><a href=\"https://github.com/tree-sitter/tree-sitter/blob/v0.27.1/lib/src/stack.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L626\" rel=\"nofollow ugc noopener\"><code>ts_malloc</code></a>, <a href=\"https://github.com/tree-sitter/tree-sitter/blob/v0.27.1/lib/src/stack.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L634\" rel=\"nofollow ugc noopener\"><code>ts_free</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/tree-sitter/tree-sitter/blob/v0.27.1/lib/src/parser.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L213\" rel=\"nofollow ugc noopener\"><code>ts_subtree_release</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/universal-ctags.html\" rel=\"nofollow ugc noopener\">universal-ctags</a></td><td><a href=\"https://github.com/universal-ctags/ctags/blob/v6.2.1/main/parse.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2405\" rel=\"nofollow ugc noopener\"><code>eStrdup</code></a>, <a href=\"https://github.com/universal-ctags/ctags/blob/v6.2.1/main/parse.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2411\" rel=\"nofollow ugc noopener\"><code>eFree</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/universal-ctags/ctags/blob/v6.2.1/main/field.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1638\" rel=\"nofollow ugc noopener\"><code>es_object_unref</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/zstandard.html\" rel=\"nofollow ugc noopener\">zstandard</a></td><td><a href=\"https://github.com/facebook/zstd/blob/v1.5.7/lib/dictBuilder/cover.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1028\" rel=\"nofollow ugc noopener\"><code>malloc</code></a>, <a href=\"https://github.com/facebook/zstd/blob/v1.5.7/lib/dictBuilder/cover.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1033\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td><a href=\"https://github.com/facebook/zstd/blob/v1.5.7/lib/compress/zstd_compress.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2042\" rel=\"nofollow ugc noopener\"><code>ZSTD_cwksp_reserve_aligned64</code></a>, <a href=\"https://github.com/facebook/zstd/blob/v1.5.7/lib/compress/zstd_compress.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L132\" rel=\"nofollow ugc noopener\"><code>ZSTD_cwksp_init</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/zlib.html\" rel=\"nofollow ugc noopener\">zlib</a></td><td><a href=\"https://github.com/madler/zlib/blob/v1.3.2/deflate.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L440\" rel=\"nofollow ugc noopener\"><code>ZALLOC</code></a>, <a href=\"https://github.com/madler/zlib/blob/v1.3.2/deflate.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1306\" rel=\"nofollow ugc noopener\"><code>ZFREE</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/xz-utils.html\" rel=\"nofollow ugc noopener\">xz-utils</a></td><td><a href=\"https://github.com/tukaani-project/xz/blob/v5.8.4/src/liblzma/common/string_conversion.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L919\" rel=\"nofollow ugc noopener\"><code>lzma_alloc</code></a>, <a href=\"https://github.com/tukaani-project/xz/blob/v5.8.4/src/liblzma/common/string_conversion.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L924\" rel=\"nofollow ugc noopener\"><code>lzma_free</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/lz4.html\" rel=\"nofollow ugc noopener\">lz4</a></td><td><a href=\"https://github.com/lz4/lz4/blob/v1.10.0/lib/lz4.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1457\" rel=\"nofollow ugc noopener\"><code>ALLOC</code></a>, <a href=\"https://github.com/lz4/lz4/blob/v1.10.0/lib/lz4.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1466\" rel=\"nofollow ugc noopener\"><code>FREEMEM</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/brotli.html\" rel=\"nofollow ugc noopener\">brotli</a></td><td><a href=\"https://github.com/google/brotli/blob/v1.2.0/c/enc/backward_references_hq.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L106\" rel=\"nofollow ugc noopener\"><code>BROTLI_ALLOC</code></a>, <a href=\"https://github.com/google/brotli/blob/v1.2.0/c/enc/backward_references_hq.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L113\" rel=\"nofollow ugc noopener\"><code>BROTLI_FREE</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/libdeflate.html\" rel=\"nofollow ugc noopener\">libdeflate</a></td><td><a href=\"https://github.com/ebiggers/libdeflate/blob/v1.26/lib/deflate_compress.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3910\" rel=\"nofollow ugc noopener\"><code>libdeflate_aligned_malloc</code></a>, <a href=\"https://github.com/ebiggers/libdeflate/blob/v1.26/lib/deflate_compress.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L4078\" rel=\"nofollow ugc noopener\"><code>libdeflate_aligned_free</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/freertos.html\" rel=\"nofollow ugc noopener\">freertos</a></td><td><a href=\"https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/V11.3.3/tasks.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1651\" rel=\"nofollow ugc noopener\"><code>pvPortMalloc</code></a>, <a href=\"https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/V11.3.3/tasks.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1668\" rel=\"nofollow ugc noopener\"><code>vPortFree</code></a></td><td>none</td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/dqlite.html\" rel=\"nofollow ugc noopener\">dqlite</a></td><td><a href=\"https://github.com/canonical/dqlite/blob/v1.18.7/src/gateway.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L330\" rel=\"nofollow ugc noopener\"><code>raft_malloc</code></a>, <a href=\"https://github.com/canonical/dqlite/blob/v1.18.7/src/gateway.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L338\" rel=\"nofollow ugc noopener\"><code>raft_free</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/canonical/dqlite/blob/v1.18.7/src/raft/replication.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L53\" rel=\"nofollow ugc noopener\"><code>logRelease</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/curl.html\" rel=\"nofollow ugc noopener\">curl</a></td><td><a href=\"https://github.com/curl/curl/blob/curl-8_23_0/lib/select.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L593\" rel=\"nofollow ugc noopener\"><code>curlx_calloc</code></a>, <a href=\"https://github.com/curl/curl/blob/curl-8_23_0/lib/select.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L598\" rel=\"nofollow ugc noopener\"><code>curlx_free</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/curl/curl/blob/curl-8_23_0/lib/creds.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L100\" rel=\"nofollow ugc noopener\"><code>Curl_creds_unlink</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/xen.html\" rel=\"nofollow ugc noopener\">xen</a></td><td><a href=\"https://github.com/xen-project/xen/blob/RELEASE-4.22.0/xen/common/vm_event.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L67\" rel=\"nofollow ugc noopener\"><code>xzalloc</code></a>, <a href=\"https://github.com/xen-project/xen/blob/RELEASE-4.22.0/xen/common/vm_event.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L103\" rel=\"nofollow ugc noopener\"><code>xfree</code></a></td><td><a href=\"https://github.com/xen-project/xen/blob/RELEASE-4.22.0/tools/libs/light/libxl_vtpm.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L43\" rel=\"nofollow ugc noopener\"><code>GCSPRINTF</code></a>, <a href=\"https://github.com/xen-project/xen/blob/RELEASE-4.22.0/tools/libs/light/libxl_vtpm.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L96\" rel=\"nofollow ugc noopener\"><code>GC_INIT</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/qemu.html\" rel=\"nofollow ugc noopener\">qemu</a></td><td><a href=\"https://github.com/qemu/qemu/blob/v11.1.2/migration/multifd-qpl.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L190\" rel=\"nofollow ugc noopener\"><code>g_new0</code></a>, <a href=\"https://github.com/qemu/qemu/blob/v11.1.2/migration/multifd-qpl.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L193\" rel=\"nofollow ugc noopener\"><code>g_free</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/qemu/qemu/blob/v11.1.2/blockdev-nbd.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L65\" rel=\"nofollow ugc noopener\"><code>object_unref</code></a></td><td><a href=\"https://github.com/qemu/qemu/blob/v11.1.2/block.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L855\" rel=\"nofollow ugc noopener\"><code>g_autofree</code></a></td></tr><tr><td><a href=\"https://theconsensus.dev/project/linux.html\" rel=\"nofollow ugc noopener\">linux</a></td><td><a href=\"https://github.com/torvalds/linux/blob/v7.2/fs/binfmt_elf.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1801\" rel=\"nofollow ugc noopener\"><code>kzalloc_obj</code></a>, <a href=\"https://github.com/torvalds/linux/blob/v7.2/fs/binfmt_elf.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1803\" rel=\"nofollow ugc noopener\"><code>kfree</code></a></td><td><a href=\"https://github.com/torvalds/linux/blob/v7.2/drivers/input/touchscreen/raydium_i2c_ts.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1069\" rel=\"nofollow ugc noopener\"><code>devm_kzalloc</code></a></td><td>none</td><td><a href=\"https://github.com/torvalds/linux/blob/v7.2/drivers/base/core.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1305\" rel=\"nofollow ugc noopener\"><code>kref_put</code></a></td><td><a href=\"https://github.com/torvalds/linux/blob/v7.2/drivers/input/touchscreen/raydium_i2c_ts.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L174\" rel=\"nofollow ugc noopener\"><code>__free</code></a></td></tr><tr><td><a href=\"https://theconsensus.dev/project/postgresql.html\" rel=\"nofollow ugc noopener\">postgresql</a></td><td><a href=\"https://github.com/postgres/postgres/blob/REL_18_6/src/bin/pg_dump/dumputils.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L766\" rel=\"nofollow ugc noopener\"><code>pg_strdup</code></a>, <a href=\"https://github.com/postgres/postgres/blob/REL_18_6/src/bin/pg_dump/dumputils.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L770\" rel=\"nofollow ugc noopener\"><code>pg_free</code></a></td><td><a href=\"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/foreign/foreign.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L69\" rel=\"nofollow ugc noopener\"><code>palloc</code></a>, <a href=\"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/tcop/postgres.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L4543\" rel=\"nofollow ugc noopener\"><code>MemoryContextReset</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/pgvector.html\" rel=\"nofollow ugc noopener\">pgvector</a></td><td>none</td><td><a href=\"https://github.com/pgvector/pgvector/blob/v0.8.6/src/vector.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L308\" rel=\"nofollow ugc noopener\"><code>palloc</code></a>, <a href=\"https://github.com/pgvector/pgvector/blob/v0.8.6/src/ivfinsert.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L216\" rel=\"nofollow ugc noopener\"><code>MemoryContextDelete</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/citus.html\" rel=\"nofollow ugc noopener\">citus</a></td><td><a href=\"https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/connection/connection_configuration.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L130\" rel=\"nofollow ugc noopener\"><code>strdup</code></a>, <a href=\"https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/connection/connection_configuration.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L100\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td><a href=\"https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/shardsplit/shardsplit_shared_memory.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L359\" rel=\"nofollow ugc noopener\"><code>palloc0</code></a>, <a href=\"https://github.com/citusdata/citus/blob/v14.2.0/src/backend/distributed/connection/connection_management.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1034\" rel=\"nofollow ugc noopener\"><code>MemoryContextReset</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/timescaledb.html\" rel=\"nofollow ugc noopener\">timescaledb</a></td><td>none</td><td><a href=\"https://github.com/timescale/timescaledb/blob/2.30.0/src/constraint.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L119\" rel=\"nofollow ugc noopener\"><code>palloc</code></a>, <a href=\"https://github.com/timescale/timescaledb/blob/2.30.0/src/hypertable_cache.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L62\" rel=\"nofollow ugc noopener\"><code>AllocSetContextCreate</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/postgis.html\" rel=\"nofollow ugc noopener\">postgis</a></td><td><a href=\"https://github.com/postgis/postgis/blob/3.6.4/liblwgeom/gserialized1.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L240\" rel=\"nofollow ugc noopener\"><code>lwalloc</code></a>, <a href=\"https://github.com/postgis/postgis/blob/3.6.4/liblwgeom/gserialized1.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L247\" rel=\"nofollow ugc noopener\"><code>lwfree</code></a></td><td><a href=\"https://github.com/postgis/postgis/blob/3.6.4/libpgcommon/shared_gserialized.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L30\" rel=\"nofollow ugc noopener\"><code>palloc</code></a>, <a href=\"https://github.com/postgis/postgis/blob/3.6.4/libpgcommon/lwgeom_pg.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L172\" rel=\"nofollow ugc noopener\"><code>AllocSetContextCreate</code></a></td><td>none</td><td><a href=\"https://github.com/postgis/postgis/blob/3.6.4/libpgcommon/lwgeom_cache.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L183\" rel=\"nofollow ugc noopener\"><code>shared_gserialized_unref</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/nginx.html\" rel=\"nofollow ugc noopener\">nginx</a></td><td><a href=\"https://github.com/nginx/nginx/blob/release-1.31.6/src/http/v3/ngx_http_v3_table.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L337\" rel=\"nofollow ugc noopener\"><code>ngx_alloc</code></a>, <a href=\"https://github.com/nginx/nginx/blob/release-1.31.6/src/http/v3/ngx_http_v3_table.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L344\" rel=\"nofollow ugc noopener\"><code>ngx_free</code></a></td><td><a href=\"https://github.com/nginx/nginx/blob/release-1.31.6/src/http/ngx_http_request.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L584\" rel=\"nofollow ugc noopener\"><code>ngx_create_pool</code></a>, <a href=\"https://github.com/nginx/nginx/blob/release-1.31.6/src/http/ngx_http_request.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L591\" rel=\"nofollow ugc noopener\"><code>ngx_destroy_pool</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/apache-http-server.html\" rel=\"nofollow ugc noopener\">apache-http-server</a></td><td><a href=\"https://github.com/apache/httpd/blob/2.4.69/modules/generators/cgi_common.h?utm_source=theconsensus.dev&amp;utm_medium=referral#L318\" rel=\"nofollow ugc noopener\"><code>apr_bucket_alloc</code></a>, <a href=\"https://github.com/apache/httpd/blob/2.4.69/modules/generators/cgi_common.h?utm_source=theconsensus.dev&amp;utm_medium=referral#L323\" rel=\"nofollow ugc noopener\"><code>apr_bucket_free</code></a></td><td><a href=\"https://github.com/apache/httpd/blob/2.4.69/server/mpm/prefork/prefork.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L448\" rel=\"nofollow ugc noopener\"><code>apr_pool_create</code></a>, <a href=\"https://github.com/apache/httpd/blob/2.4.69/server/mpm/prefork/prefork.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L559\" rel=\"nofollow ugc noopener\"><code>apr_pool_clear</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/llama-cpp.html\" rel=\"nofollow ugc noopener\">llama-cpp (ggml C)</a></td><td><a href=\"https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml-alloc.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L164\" rel=\"nofollow ugc noopener\"><code>calloc</code></a>, <a href=\"https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml-alloc.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L354\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td><a href=\"https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2489\" rel=\"nofollow ugc noopener\"><code>ggml_new_tensor_1d</code></a>, <a href=\"https://github.com/ggml-org/llama.cpp/blob/b11457/ggml/src/ggml-cpu/ggml-cpu.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3864\" rel=\"nofollow ugc noopener\"><code>ggml_free</code></a></td><td>none</td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/python.html\" rel=\"nofollow ugc noopener\">python</a></td><td><a href=\"https://github.com/python/cpython/blob/v3.14.7/Objects/memoryobject.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3241\" rel=\"nofollow ugc noopener\"><code>PyMem_Malloc</code></a>, <a href=\"https://github.com/python/cpython/blob/v3.14.7/Objects/memoryobject.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3247\" rel=\"nofollow ugc noopener\"><code>PyMem_Free</code></a></td><td><a href=\"https://github.com/python/cpython/blob/v3.14.7/Python/pythonrun.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L314\" rel=\"nofollow ugc noopener\"><code>_PyArena_New</code></a>, <a href=\"https://github.com/python/cpython/blob/v3.14.7/Python/pythonrun.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L323\" rel=\"nofollow ugc noopener\"><code>_PyArena_Free</code></a></td><td><a href=\"https://github.com/python/cpython/blob/v3.14.7/Modules/_asynciomodule.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2058\" rel=\"nofollow ugc noopener\"><code>PyObject_GC_New</code></a></td><td><a href=\"https://github.com/python/cpython/blob/v3.14.7/Objects/listobject.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L256\" rel=\"nofollow ugc noopener\"><code>Py_DECREF</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/php.html\" rel=\"nofollow ugc noopener\">php</a></td><td><a href=\"https://github.com/php/php-src/blob/php-8.5.10/ext/ffi/ffi.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3031\" rel=\"nofollow ugc noopener\"><code>emalloc</code></a>, <a href=\"https://github.com/php/php-src/blob/php-8.5.10/ext/ffi/ffi.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3033\" rel=\"nofollow ugc noopener\"><code>efree</code></a></td><td><a href=\"https://github.com/php/php-src/blob/php-8.5.10/sapi/phpdbg/phpdbg_print.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L370\" rel=\"nofollow ugc noopener\"><code>zend_arena_alloc</code></a>, <a href=\"https://github.com/php/php-src/blob/php-8.5.10/ext/opcache/ZendAccelerator.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L4108\" rel=\"nofollow ugc noopener\"><code>zend_arena_release</code></a></td><td><a href=\"https://github.com/php/php-src/blob/php-8.5.10/Zend/zend_execute_API.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L423\" rel=\"nofollow ugc noopener\"><code>gc_collect_cycles</code></a></td><td><a href=\"https://github.com/php/php-src/blob/php-8.5.10/Zend/zend.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1637\" rel=\"nofollow ugc noopener\"><code>zend_string_release</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/perl.html\" rel=\"nofollow ugc noopener\">perl</a></td><td><a href=\"https://github.com/Perl/perl5/blob/v5.44.0/av.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L172\" rel=\"nofollow ugc noopener\"><code>Newx</code></a>, <a href=\"https://github.com/Perl/perl5/blob/v5.44.0/av.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L174\" rel=\"nofollow ugc noopener\"><code>Safefree</code></a></td><td>none</td><td>none</td><td><a href=\"https://github.com/Perl/perl5/blob/v5.44.0/av.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L383\" rel=\"nofollow ugc noopener\"><code>SvREFCNT_dec</code></a></td><td><a href=\"https://github.com/Perl/perl5/blob/v5.44.0/pp_hot.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L6867\" rel=\"nofollow ugc noopener\"><code>sv_2mortal</code></a></td></tr><tr><td><a href=\"https://theconsensus.dev/project/lua.html\" rel=\"nofollow ugc noopener\">lua</a></td><td><a href=\"https://github.com/lua/lua/blob/v5.5.1/lparser.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L179\" rel=\"nofollow ugc noopener\"><code>luaM_growvector</code></a>, <a href=\"https://github.com/lua/lua/blob/v5.5.1/ldo.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L1185\" rel=\"nofollow ugc noopener\"><code>luaM_freearray</code></a></td><td>none</td><td><a href=\"https://github.com/lua/lua/blob/v5.5.1/lapi.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L546\" rel=\"nofollow ugc noopener\"><code>luaS_new</code></a></td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/ruby.html\" rel=\"nofollow ugc noopener\">ruby</a></td><td><a href=\"https://github.com/ruby/ruby/blob/v4.0.6/prism_compile.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L11237\" rel=\"nofollow ugc noopener\"><code>xmalloc</code></a>, <a href=\"https://github.com/ruby/ruby/blob/v4.0.6/prism_compile.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L11239\" rel=\"nofollow ugc noopener\"><code>xfree</code></a></td><td>none</td><td><a href=\"https://github.com/ruby/ruby/blob/v4.0.6/ast.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L286\" rel=\"nofollow ugc noopener\"><code>TypedData_Make_Struct</code></a></td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/emacs.html\" rel=\"nofollow ugc noopener\">emacs</a></td><td><a href=\"https://github.com/emacs-mirror/emacs/blob/emacs-31.1/src/sysdep.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3369\" rel=\"nofollow ugc noopener\"><code>xmalloc</code></a>, <a href=\"https://github.com/emacs-mirror/emacs/blob/emacs-31.1/src/sysdep.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L3372\" rel=\"nofollow ugc noopener\"><code>xfree</code></a></td><td>none</td><td><a href=\"https://github.com/emacs-mirror/emacs/blob/emacs-31.1/src/alloc.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L2641\" rel=\"nofollow ugc noopener\"><code>Fcons</code></a></td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/ocaml.html\" rel=\"nofollow ugc noopener\">ocaml</a></td><td><a href=\"https://github.com/ocaml/ocaml/blob/5.5.1/runtime/win32.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L679\" rel=\"nofollow ugc noopener\"><code>caml_stat_alloc</code></a>, <a href=\"https://github.com/ocaml/ocaml/blob/5.5.1/runtime/win32.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L681\" rel=\"nofollow ugc noopener\"><code>caml_stat_free</code></a></td><td>none</td><td><a href=\"https://github.com/ocaml/ocaml/blob/5.5.1/runtime/bigarray.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L726\" rel=\"nofollow ugc noopener\"><code>caml_copy_double</code></a></td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/erlang.html\" rel=\"nofollow ugc noopener\">erlang</a></td><td><a href=\"https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/erl_thr_progress.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L337\" rel=\"nofollow ugc noopener\"><code>erts_alloc</code></a>, <a href=\"https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/erl_thr_progress.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L355\" rel=\"nofollow ugc noopener\"><code>erts_free</code></a></td><td>none</td><td><a href=\"https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/beam_bif_load.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L257\" rel=\"nofollow ugc noopener\"><code>HAlloc</code></a></td><td><a href=\"https://github.com/erlang/otp/blob/OTP-29.0.6/erts/emulator/beam/beam_load.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L698\" rel=\"nofollow ugc noopener\"><code>erts_bin_release</code></a></td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/julia.html\" rel=\"nofollow ugc noopener\">julia</a></td><td><a href=\"https://github.com/JuliaLang/julia/blob/v1.12.7/src/sys.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L656\" rel=\"nofollow ugc noopener\"><code>malloc_s</code></a>, <a href=\"https://github.com/JuliaLang/julia/blob/v1.12.7/src/sys.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L659\" rel=\"nofollow ugc noopener\"><code>free</code></a></td><td>none</td><td><a href=\"https://github.com/JuliaLang/julia/blob/v1.12.7/src/array.c?utm_source=theconsensus.dev&amp;utm_medium=referral#L64\" rel=\"nofollow ugc noopener\"><code>jl_gc_alloc</code></a></td><td>none</td><td>none</td></tr><tr><td><a href=\"https://theconsensus.dev/project/sel4.html\" rel=\"nofollow ugc noopener\">sel4</a></td><td>none</td><td>none</td><td>none</td><td>none</td><td>none</td></tr></tbody></table></div>\n<p>Get new deep dives like this one, plus new jobs and funding news in software infrastructure, free in your inbox every week.</p>\n<p><a href=\"https://theconsensus.dev/author/phil-eaton.html\" rel=\"nofollow ugc noopener\">Phil Eaton</a></p>\n<p>Phil is the founder of The Consensus. Before this, he was a staff engineer on a distributed Postgres product at EnterpriseDB, cofounded and led marketing at TigerBeetle, and was an engineering manager at Oracle. He runs the Software Internals Discord and the Software Internals Email Book Club. <a href=\"https://twitter.com/eatonphil?utm_source=theconsensus.dev&amp;utm_medium=referral\" rel=\"nofollow ugc noopener\">@eatonphil</a></p>","headings":[{"level":1,"text":"Memory management in 40 major C projects, a survey","id":"memory-management-in-40-major-c-projects-a-survey"},{"level":2,"text":"Majority allocation strategy#","id":"majority-allocation-strategy"},{"level":2,"text":"All projects#","id":"all-projects"}]}}