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

Memory limit should be respected.
class ISystemLog
{
public:
    virtual String getName() = 0;
    virtual ASTPtr getCreateTableQuery() = 0;
    
    virtual void flush(bool force = false) = 0;
    virtual void prepareTable() = 0;
    virtual void startup() = 0;
    virtual void shutdown() = 0;
    virtual ~ISystemLog() = default;
};
struct SystemLogs
{
    SystemLogs(Context & global_context, const Poco::Util::AbstractConfiguration & config);
    ~SystemLogs();
    void shutdown();
    std::shared_ptr<QueryLog> query_log;                
    std::shared_ptr<QueryThreadLog> query_thread_log;   
    std::shared_ptr<PartLog> part_log;                  
    std::shared_ptr<TraceLog> trace_log;                
    std::shared_ptr<CrashLog> crash_log;                
    std::shared_ptr<TextLog> text_log;                  
    std::shared_ptr<MetricLog> metric_log;              
    
    std::shared_ptr<AsynchronousMetricLog> asynchronous_metric_log;
    std::vector<ISystemLog *> logs;
};
template <typename LogElement>
class SystemLog : public ISystemLog, private boost::noncopyable