https://rethinkdb.com/blog/handling-stack-overflow-on-custom-stacks/

https://barrgroup.com/embedded-systems/how-to/prevent-detect-stack-overflow 

etc.
: thread_id{getThreadId()}
{
    last_rusage = std::make_unique<RUsageCounters>();
    memory_tracker.setDescription("(for thread)");
    log = &Poco::Logger::get("ThreadStatus");
    current_thread = this;
    
    
}
ThreadStatus::~ThreadStatus()
{
    try
    {
        if (untracked_memory > 0)
            memory_tracker.alloc(untracked_memory);
        else
            memory_tracker.free(-untracked_memory);
    }
    catch (const DB::Exception &)
    {
        
        
    }
    if (deleter)
        deleter();
    current_thread = nullptr;
}
void ThreadStatus::updatePerformanceCounters()