v.23.7New Feature

System Table jemalloc_bins for Memory Allocation Stats

A system table jemalloc_bins to show stats for jemalloc bins. Example SELECT *, size * (nmalloc - ndalloc) AS allocated_bytes FROM system.jemalloc_bins WHERE allocated_bytes > 0 ORDER BY allocated_bytes DESC LIMIT 10. Enjoy. #51674 (Alexander Gololobov).
Introduced a new system table jemalloc_bins that provides detailed statistics about jemalloc memory allocator bins.

Why it matters

This feature allows users to monitor and analyze jemalloc memory allocation at the bin level, helping to identify and troubleshoot memory usage patterns and potential leaks in ClickHouse instances.

How to use it

Users can query the system.jemalloc_bins table directly using SQL. For example, use the following query to display the top 10 bins by allocated bytes:

SELECT , size  (nmalloc - ndalloc) AS allocated_bytes
FROM system.jemalloc_bins
WHERE allocated_bytes > 0
ORDER BY allocated_bytes DESC
LIMIT 10