Skip to content
Opensource internals
  • Posts

Posts

All posts published on this site.

Everything published here, newest first.

ClickHouse Turns an Out-of-Memory Into an Exception: Code 241, Not a Killed Process

Oct 20, 2026 18 min read Jay Hubbert

When a ClickHouse query exceeds its memory budget, the allocation is refused with a MEMORY_LIMIT_EXCEEDED exception.

ClickhousePerformanceInternalsMemoryOom

Read more →

ClickHouse Intercepts Every Allocation: It Charges the Size Class, Not the Request

Oct 20, 2026 19 min read Jay Hubbert

ClickHouse replaces operator new and interposes the libc malloc symbols so every allocation is charged.

ClickhousePerformanceInternalsMemoryMemory trackingJemalloc

Read more →

ClickHouse Batches Memory Charges Per Thread: 4 MiB Before It Touches the Tracker

Oct 20, 2026 20 min read Jay Hubbert

ClickHouse does not charge the memory tracker on every allocation; each thread batches up to 4 MiB locally.

ClickhousePerformanceInternalsMemoryMemory tracking

Read more →

ClickHouse Shares One AST Between Threads: 32-Byte Nodes and an Iterative Destructor

Oct 20, 2026 15 min read Jay Hubbert

The ClickHouse AST is a tree of 32-byte reference-counted nodes with a bit-packed flag word and an iterative destructor.

ClickhousePerformanceInternalsAstParser

Read more →

ClickHouse's Lexer Never Allocates: A Token Is Two Pointers Into the Query Buffer

Oct 20, 2026 14 min read Jay Hubbert

ClickHouse tokenizes SQL with a pointer-arithmetic lexer that never allocates and knows nothing about keywords.

ClickhousePerformanceInternalsParserLexer

Read more →

← Newer Page 43 of 83 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·