mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #61132 from ClickHouse/more_memory_checks
Throw memory limit exceptions to avoid OOM in some places
This commit is contained in:
commit
40a992e1db
@ -3,6 +3,7 @@
|
||||
#include <Processors/Port.h>
|
||||
#include <Processors/IProcessor.h>
|
||||
#include <Common/SharedMutex.h>
|
||||
#include <Common/AllocatorWithMemoryTracking.h>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <stack>
|
||||
@ -117,7 +118,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
using Queue = std::queue<Node *>;
|
||||
/// This queue can grow a lot and lead to OOM. That is why we use non-default
|
||||
/// allocator for container which throws exceptions in operator new
|
||||
using DequeWithMemoryTracker = std::deque<ExecutingGraph::Node *, AllocatorWithMemoryTracking<ExecutingGraph::Node *>>;
|
||||
using Queue = std::queue<ExecutingGraph::Node *, DequeWithMemoryTracker>;
|
||||
|
||||
using NodePtr = std::unique_ptr<Node>;
|
||||
using Nodes = std::vector<NodePtr>;
|
||||
Nodes nodes;
|
||||
|
@ -47,7 +47,10 @@ class ExecutorTasks
|
||||
|
||||
public:
|
||||
using Stack = std::stack<UInt64>;
|
||||
using Queue = std::queue<ExecutingGraph::Node *>;
|
||||
/// This queue can grow a lot and lead to OOM. That is why we use non-default
|
||||
/// allocator for container which throws exceptions in operator new
|
||||
using DequeWithMemoryTracker = std::deque<ExecutingGraph::Node *, AllocatorWithMemoryTracking<ExecutingGraph::Node *>>;
|
||||
using Queue = std::queue<ExecutingGraph::Node *, DequeWithMemoryTracker>;
|
||||
|
||||
void finish();
|
||||
bool isFinished() const { return finished; }
|
||||
|
@ -5,7 +5,9 @@
|
||||
#include <Common/EventCounter.h>
|
||||
#include <Common/ThreadPool_fwd.h>
|
||||
#include <Common/ConcurrencyControl.h>
|
||||
#include <Common/AllocatorWithMemoryTracking.h>
|
||||
|
||||
#include <deque>
|
||||
#include <queue>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
@ -90,7 +92,10 @@ private:
|
||||
|
||||
ReadProgressCallbackPtr read_progress_callback;
|
||||
|
||||
using Queue = std::queue<ExecutingGraph::Node *>;
|
||||
/// This queue can grow a lot and lead to OOM. That is why we use non-default
|
||||
/// allocator for container which throws exceptions in operator new
|
||||
using DequeWithMemoryTracker = std::deque<ExecutingGraph::Node *, AllocatorWithMemoryTracking<ExecutingGraph::Node *>>;
|
||||
using Queue = std::queue<ExecutingGraph::Node *, DequeWithMemoryTracker>;
|
||||
|
||||
void initializeExecution(size_t num_threads, bool concurrency_control); /// Initialize executor contexts and task_queue.
|
||||
void finalizeExecution(); /// Check all processors are finished.
|
||||
|
Loading…
Reference in New Issue
Block a user