ClickHouse 23.8: steady memory growth after upgrade from 23.1 (Kafka statistics leak)

After upgrading ClickHouse from 23.1 to 23.8.x, memory usage grows steadily. Queries that used ~500 MB now use 2+ GB, and RSS climbs until a restart. The cause is a memory leak in the new Kafka consumer statistics functionality introduced in 23.8 (fixed upstream in PRs #57822 and #57829).

Set kafka.statisticsintervalms to 0 in the Kafka config group (e.g. a new file under config.d) and restart ClickHouse. The reporter confirmed memory growth stopped after 16 hours. Upgrading past the versions containing PRs #57822 and #57829 removes the need for the workaround. Source: https://github.com/ClickHouse/ClickHouse/issues/54483