v.23.5Improvement

Attach MemoryTracker to total_memory_tracker After ThreadGroup Detachment

Attach thread MemoryTracker to total_memory_tracker after ThreadGroup detached. #49527 (Dmitry Novik).
Attach thread MemoryTracker to total_memory_tracker after ThreadGroup is detached to ensure proper memory tracking for detached threads.

Why it matters

This feature solves the issue where memory usage by threads that are detached from a ThreadGroup might not be accurately tracked. By attaching the thread's MemoryTracker to total_memory_tracker after detachment, it ensures that memory consumption is still monitored and accounted for, improving overall resource management and debugging capabilities.

How to use it

This feature is automatically applied in the system when threads are detached from a ThreadGroup. Users do not need to enable it manually; it transparently enhances memory tracking for detached threads.