v.23.5Improvement

Release Memory for Last ProfileEvents Snapshot in Query Context

Release memory allocated for the last sent ProfileEvents snapshot in the context of a query. Followup #47564. #49561 (Dmitry Novik).
Release memory allocated for the last sent ProfileEvents snapshot in the context of a query.

Why it matters

This feature addresses a memory management issue by freeing memory used for the most recent ProfileEvents snapshot associated with a query. It improves resource utilization and prevents memory bloat in long-running or complex queries.

How to use it

This improvement is applied internally within ClickHouse and does not require any user configuration or explicit activation.