v.23.5Improvement

Add CGroup v2 Support for Asynchronous Memory Metrics

Add support for CGroup version 2 for asynchronous metrics about the memory usage and availability. This closes #37983. #45999 (sichenzhao).
Add support for CGroup version 2 to collect asynchronous metrics on memory usage and availability.

Why it matters

This feature addresses the need to accurately monitor memory usage and availability in environments using CGroup version 2, providing better resource tracking and management for ClickHouse instances running in containerized or resource-controlled setups.

How to use it

Ensure your system uses CGroup version 2. ClickHouse will automatically gather asynchronous memory usage metrics using the new CGroup v2 support without requiring additional configuration.