---
title: "Memory management (hard)"
description: "Allocation, garbage collection, ownership, memory leaks"
url: "https://swe.quest/tags/memory-management?difficulty=hard"
---

# Memory management (hard)

Topic in Compilers & runtimes: Allocation, garbage collection, ownership, memory leaks

By difficulty: [Easy](https://swe.quest/tags/memory-management.md?difficulty=easy) · [Medium](https://swe.quest/tags/memory-management.md?difficulty=medium) · [Hard](https://swe.quest/tags/memory-management.md?difficulty=hard)

Posts 1–24 of 37, page 1 of 2, newest first.

## 2026-11-07

- [Progress Report: Linux 7.3](https://swe.quest/articles/progress-report-linux-7-3-128fc5535e6dbd29.md): Asahi Linux · 2026-11-07 · Hard · 14 min read · Linux, Hardware, Virtualization, Memory management, Games
  Asahi Linux's 7.3-cycle report covers upstream submission of the macaudio and AVD (~13,000 lines) drivers, initial M4 Pro/Max and M5 Devicetrees, and M3 support going generally available with DCP enabling sleep and the notch area. m1n1 now runs three EL1 VMs (macOS, SPTM, and the Secure Kernel with Exclaves) to reverse engineer M5 macOS.

## 2026-09-30

- [Memory safety for Postgres extensions in C/C++](https://swe.quest/articles/memory-safety-for-postgres-extensions-in-c-c-b6883b8eb3b1e33d.md): ClickHouse · 2026-09-30 · Hard · 4 min read · PostgreSQL, Memory safety, C & C++, Memory management
  Postgres's palloc/MemoryContext allocation and setjmp/longjmp-based error handling clash with C++ new/delete, destructors and exceptions: longjmp skips destructors (undefined behavior), exceptions bypass PG\_CATCH, and an uncaught exception aborts the process and forces cluster-wide crash recovery.
- [Trading off compute for memory with activation checkpointing](https://swe.quest/articles/trading-off-compute-for-memory-with-activation-checkpointing-1f2b8d13685e738d.md): Jane Street Tech Blog · 2026-09-30 · Hard · 9 min read · Model training, Memory management, Compilers, Performance engineering, Python
  A whole-graph activation checkpointing planner for torch.compile takes an absolute GB memory budget and greedily drops min-cut saves with the cheapest recompute cost per byte of peak memory freed.

## 2026-09-28

- [Can your Postgres survive a bad query?](https://swe.quest/articles/can-your-postgres-survive-a-bad-query-744ea9a22b65710c.md): ClickHouse · 2026-09-28 · Hard · 13 min read · PostgreSQL, Memory management, Resilience, Query engines, Linux
  Postgres's \`work\_mem\` limits memory per plan node per process, not per query, so parallel workers and \`hash\_mem\_multiplier\` can push a simple aggregation past 8x \`work\_mem\`.

## 2026-09-16

- [Size-Specialized Memory Allocation](https://swe.quest/articles/size-specialized-memory-allocation-cb92a01eba7d925f.md): The Go Blog · 2026-09-16 · Hard · 7 min read · Memory management, Go, Runtimes & VMs, Performance engineering
  Go 1.27 adds size-specialized variants of the runtime's mallocgc for allocations of 80 bytes or fewer, one per span class (size class plus pointer/no-pointer), making these allocations 20-30% faster and allocation-heavy programs up to 1% faster.

## 2026-09-09

- [Improving Lakebase Postgres Compute Cache on Neon, Part 1](https://swe.quest/articles/improving-lakebase-postgres-compute-cache-on-neon-part-1-96696f73ade727a0.md): Neon · 2026-09-09 · Hard · 9 min read · PostgreSQL, Caching, Performance engineering, Memory management, Virtualization
  On large fixed-size Lakebase Postgres computes, Neon now disables its NVMe-backed local file cache and sets shared buffers to 75% of DRAM (up from a 1 GB cap), backed by explicit 2 MB HugeTLB pages provisioned through host, hypervisor and guest VM.

## 2026-08-10

- [Making Knowledge Distillation Cheap Enough to Run at Scale](https://swe.quest/articles/making-knowledge-distillation-cheap-enough-to-run-at-scale-f55a4297b4be9cef.md): Hugging Face · 2026-08-10 · Hard · 8 min read · Model training, LLMs, Performance engineering, Memory management
  Two systems changes make LLM knowledge distillation far cheaper: caching the teacher's top-100 logits offline so the teacher never shares memory with the student, and a fused chunked KL loss that folds the output projection into the loss and recomputes chunks in the backward pass, so the full vocabulary × sequence logits grid is never materialized.

## 2026-07-13

- [Turso v0.7.0](https://swe.quest/articles/turso-v0-7-0-8d3ff93b34352c14.md): Turso · 2026-07-13 · Hard · 10 min read · SQLite, Storage engines, Consistency models, Memory management, Rust
  Turso 0.7 drops the beta label and focuses on performance and robustness for embedded, multi-tenant use: the core no longer blocks on I/O, yields CPU via a new StepResult::Yield, moves to fallible allocation so OOM surfaces as an error, and treats the page cache as a soft limit like SQLite.

## 2026-06-15

- [Using OxCaml to implement type-safe reference counting between OCaml and Python](https://swe.quest/articles/using-oxcaml-to-implement-type-safe-reference-counting-between-ocaml-and-python-6289aa53698f2fb6.md): Jane Street Tech Blog · 2026-06-15 · Hard · 12 min read · Functional programming, Memory management, Type systems, Python
  Wrapping Python objects as OCaml values in PyOCaml ties each object's release to the OCaml GC finalizer, so large data frames or GPU buffers can stay alive long after Python code drops them.

## 2026-05-01

- [Cycles Texture Cache](https://swe.quest/articles/cycles-texture-cache-778aa21fc39107df.md): Blender Developers Blog · 2026-05-01 · Hard · 5 min read · Computer vision, Memory management, Caching, Performance engineering
  Blender 5.2 LTS adds a Cycles texture cache that loads only the image tiles and mipmap resolutions a render actually needs, cutting memory use in texture-heavy scenes.

## 2026-04-21

- [Index sharding in ClickHouse Cloud: Petabyte-scale data needs petabyte-scale indexing](https://swe.quest/articles/index-sharding-in-clickhouse-cloud-petabyte-scale-data-needs-petabyte-scale-162dcf2c4093c588.md): ClickHouse · 2026-04-21 · Hard · 16 min read · Query engines, Analytics & OLAP, Distributed databases, Memory management, Performance engineering
  Index sharding in ClickHouse Cloud splits primary and secondary index analysis across replicas using consistent hashing over data parts.

## 2026-03-31

- [Introducing the JetStream 3 Benchmark Suite](https://swe.quest/articles/introducing-the-jetstream-3-benchmark-suite-df1c85fb12e2a75d.md): WebKit · 2026-03-31 · Hard · 21 min read · Runtimes & VMs, WebAssembly, Compilers, Memory management, Performance engineering
  JetStream 3 replaces JetStream 2's separate Wasm Startup/Runtime scores with the JavaScript-style first-iteration, worst-case and average-case scoring.

## 2025-12-18

- [Taming PostgreSQL GUC “extra” Data](https://swe.quest/articles/taming-postgresql-guc-extra-data-7e376007c1715e0d.md): ClickHouse · 2025-12-18 · Hard · 8 min read · PostgreSQL, C & C++, Memory management, Configuration management
  PostgreSQL GUC check and assign hooks can pre-parse a custom string setting into a structured value, but only if the "extra" data follows the GUC API's memory rules.

## 2025-12-16

- [Parallelizing ClickHouse aggregation merge for fixed hash map](https://swe.quest/articles/parallelizing-clickhouse-aggregation-merge-for-fixed-hash-map-9fc83cd0ed214dc7.md): ClickHouse · 2025-12-16 · Hard · 6 min read · Query engines, Performance engineering, Concurrency, Memory management, C & C++
  ClickHouse 25.11 parallelizes the merge phase for GROUP BY on 8- and 16-bit keys, which use an array-backed FixedHashMap.

## 2025-11-19

- [chDB Kernel Upgrade Journey: Upgrading ClickHouse to v25.8.2.29](https://swe.quest/articles/chdb-kernel-upgrade-journey-upgrading-clickhouse-to-v25-8-2-29-3cca5f2ad115d794.md): ClickHouse · 2025-11-19 · Hard · 16 min read · Memory management, C & C++, Python, Analytics & OLAP, Performance engineering
  Upgrading chDB's embedded ClickHouse kernel from v25.5 to v25.8.2.29 surfaced allocator conflicts rooted in chDB's dual-library design: a stable-ABI \`\_chdb.abi3.so\` holding the ~120MB engine plus small per-Python-version pybind11 binding libraries.

## 2025-09-17

- [Optimizing ClickHouse for Intel's ultra-high core count processors](https://swe.quest/articles/optimizing-clickhouse-for-intel-s-ultra-high-core-count-processors-93479313e687f95e.md): ClickHouse · 2025-09-17 · Hard · 22 min read · Performance engineering, Concurrency, Memory management, Analytics & OLAP, Hardware
  Intel engineers profiled all 43 ClickBench queries on 160–480 vCPU Xeon systems and landed a series of ClickHouse optimizations targeting lock contention, memory management and other scaling bottlenecks.

## 2025-08-27

- [What the interns have wrought, 2025 edition](https://swe.quest/articles/what-the-interns-have-wrought-2025-edition-eda7f47e78fb3ca5.md): Jane Street Tech Blog · 2025-08-27 · Hard · 12 min read · Functional programming, Memory management, Query engines, Type systems, Performance engineering
  Jane Street's 2025 intern projects include an index-aware evaluator for JSQL, the company's internal SQL dialect, which over-approximates key ranges from WHERE clauses and specializes execution to Map, Hashtbl or multi-index containers, giving ~700x and ~30x speedups on 3.8M-row benchmarks.

## 2025-03-05

- [The case of the vanishing CPU: A Linux kernel debugging story](https://swe.quest/articles/the-case-of-the-vanishing-cpu-a-linux-kernel-debugging-story-3db1aa1b81ec8319.md): ClickHouse · 2025-03-05 · Hard · 32 min read · Linux, Memory management, Debugging, Performance engineering, Incidents & postmortems
  Intermittent, indefinite CPU saturation of ClickHouse Cloud pods, seen only on GCP, turned out to be a Linux kernel memory-management livelock.

## 2025-02-25

- [Turbocharging V8 with mutable heap numbers](https://swe.quest/articles/turbocharging-v8-with-mutable-heap-numbers-d32025b1d5ea1f1c.md): V8 · 2025-02-25 · Hard · 5 min read · Runtimes & VMs, Compilers, JavaScript, Performance engineering, Memory management
  V8 eliminated a performance cliff in JetStream2's async-fs benchmark caused by a custom Math.random whose \`seed\` lives in a ScriptContext slot.

## 2024-11-05

- [How Bun supports V8 APIs without using V8 (part 2)](https://swe.quest/articles/how-bun-supports-v8-apis-without-using-v8-part-2-d765ff746fe7a86a.md): Bun · 2024-11-05 · Hard · 18 min read · Runtimes & VMs, JavaScript, C & C++, Memory management
  Bun emulates V8's memory layout on top of JavaScriptCore so that precompiled native addons, which inline V8 functions assuming specific pointer layouts, keep working.

## 2024-09-30

- [How Bun supports V8 APIs without using V8 (part 1)](https://swe.quest/articles/how-bun-supports-v8-apis-without-using-v8-part-1-ff8148b61cb465d8.md): Bun · 2024-09-30 · Hard · 19 min read · Runtimes & VMs, C & C++, JavaScript, Memory management
  Bun, which runs on JavaScriptCore, implements a growing subset of V8's C++ embedding API so Node.js native modules like cpu-features load without V8.

## 2024-08-29

- [ICFP 2024](https://swe.quest/articles/icfp-2024-a2b848db9d4cf383.md): Jane Street Tech Blog · 2024-08-29 · Hard · 8 min read · Functional programming, Type systems, Language design, Memory management, Compilers
  Jane Street's OCaml Language team brings nine papers and talks to ICFP 2024 and describes its compiler-branch extensions: modal types (modes like local and unique) for Rust-like control over allocation and data-race-free parallelism, and a kind system for unboxed layouts.

## 2024-05-20

- [.NET Continuous Profiler: Memory usage](https://swe.quest/articles/net-continuous-profiler-memory-usage-51d84deba820efcb.md): Datadog Engineering · 2024-05-20 · Hard · 9 min read · .NET, Memory management, Observability, Performance engineering, Runtimes & VMs
  Datadog's .NET continuous profiler measures memory in three ways.

## 2024-04-15

- [1 Year of Autoscaling Postgres: How it’s going, and what’s next](https://swe.quest/articles/1-year-of-autoscaling-postgres-how-it-s-going-and-what-s-next-a75ce75d92118903.md): Neon · 2024-04-15 · Hard · 8 min read · PostgreSQL, Virtualization, Capacity planning, Memory management, Kubernetes
  Neon autoscales Postgres by running each instance as a VM in Kubernetes (NeonVM), with a per-node autoscaler-agent, a modified scheduler, and an in-VM vm-monitor that resizes the Local File Cache.

[Next page](https://swe.quest/tags/memory-management.md?difficulty=hard&page=2)

Same list as RSS: [https://swe.quest/feed.xml?difficulty=hard&tag=memory-management](https://swe.quest/feed.xml?difficulty=hard&tag=memory-management). Lists take `?page=`, `?per=12|24|48|96` and, on the home page, `?tag=` (up to 3), `?source=`, `?difficulty=easy|medium|hard` and `?search=`.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
