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

Memory limit should be respected.
{
    setThreadName("SystemLogFlush");
    std::vector<LogElement> to_flush;
    bool exit_this_thread = false;
    while (!exit_this_thread)
    {
        try
        {
            
            
            uint64_t to_flush_end = 0;
            {
                std::unique_lock lock(mutex);
                flush_event.wait_for(lock,
                    std::chrono::milliseconds(flush_interval_milliseconds),
                    [&] ()
                    {
                        return requested_flush_before > flushed_before || is_shutdown || is_force_prepare_tables;
                    }
                );
                queue_front_index += queue.size();
                to_flush_end = queue_front_index;
                
                
                to_flush.resize(0);
                queue.swap(to_flush);
                exit_this_thread = is_shutdown;
            }