v.23.8New Feature

Add ptr column to system.trace_log for MemorySample and implement flameGraph function

Add column ptr to system.trace_log for trace_type = 'MemorySample'. This column contains an address of allocation. Added function flameGraph which can build flamegraph containing allocated and not released memory. Reworking of #38391. #45322 (Nikolai Kochetov).
Added a new ptr column to system.trace_log for trace_type = 'MemorySample' that stores the address of memory allocations, along with a new flameGraph function to generate flamegraphs illustrating allocated and unreleased memory.

Why it matters

This feature addresses the need to better analyze memory allocation patterns and detect memory leaks by providing precise allocation addresses and visual flamegraphs. It enhances diagnostic capabilities for memory usage within ClickHouse, helping users identify and troubleshoot memory issues more effectively.

How to use it

To use this feature, query system.trace_log with trace_type = 'MemorySample' to access the ptr column containing allocation addresses. Use the flameGraph function to build flamegraphs of allocated and not released memory for detailed visualization and analysis.