ClickHouse Turns an Out-of-Memory Into an Exception: Code 241, Not a Killed Process
When a ClickHouse query exceeds its memory budget, the allocation is refused with a MEMORY_LIMIT_EXCEEDED exception.
All posts published on this site.
Everything published here, newest first.
When a ClickHouse query exceeds its memory budget, the allocation is refused with a MEMORY_LIMIT_EXCEEDED exception.
ClickHouse replaces operator new and interposes the libc malloc symbols so every allocation is charged.
ClickHouse does not charge the memory tracker on every allocation; each thread batches up to 4 MiB locally.
The ClickHouse AST is a tree of 32-byte reference-counted nodes with a bit-packed flag word and an iterative destructor.
ClickHouse tokenizes SQL with a pointer-arithmetic lexer that never allocates and knows nothing about keywords.