**Describe the bug**
`SELECT i FROM generateRandom('i Array(Int8)', 1048575, 10, 1048577) LIMIT 1048575`

Memory limit should be respected.
{
    {
        std::lock_guard lock(mutex);
        if (!saving_thread.joinable())
        {
            return;
        }
        if (is_shutdown)
        {
            return;
        }
        is_shutdown = true;
        
        flush_event.notify_all();
    }
    saving_thread.join();
}
template <typename LogElement>
void SystemLog<LogElement>::savingThreadFunction()