v.22.3Improvement

Implement Memory Statistics for FreeBSD for max_server_memory_usage

Implement memory statistics for FreeBSD - this is required for max_server_memory_usage to work correctly. #34902 (Alexandre Snarskii).
Implemented memory statistics support for FreeBSD to enable accurate tracking of server memory usage in ClickHouse.

Why it matters

This feature provides necessary memory statistics for FreeBSD operating systems, allowing the max_server_memory_usage setting to function correctly. It solves the issue of inaccurate or unavailable memory usage data on FreeBSD, improving resource management and stability of ClickHouse servers on this platform.

How to use it

The feature is automatically enabled on FreeBSD systems. Users can utilize the max_server_memory_usage setting to limit server memory usage based on accurate memory statistics collected by ClickHouse.