Skip to content

Memory tracking issue in groupBitmapState ? #26555

@filimonov

Description

@filimonov

That query uses about 10Gb of RAM, should fail with that setting.
In practice it can go OOM, and clickhouse memory tracker doesn't know about that:

SET max_threads = 8, max_memory_usage = '3G';
CREATE TABLE oom_issue ENGINE = AggregatingMergeTree ORDER BY n AS SELECT cityHash64(rand() % 1000) as n, groupBitmapState(number) FROM numbers_mt(2000000000) GROUP BY n;
[laptop-5591] 2021.07.20 13:22:45.739115 [ 272424 ] {cda8ab45-5c7c-47de-83eb-14ec6d0fdb4c} <Debug> MemoryTracker: Peak memory usage (for query): 6.53 MiB.

Metadata

Metadata

Labels

comp-aggregate-functionsAggregate function implementations (sum, avg, count, quantile, combinators, etc.).memoryWhen memory usage is higher than expectedminorPriority: minor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions