Reduce memory blowup on each Pull

Reviewers: teon.banek, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2509
This commit is contained in:
Matej Ferencevic 2019-10-22 22:00:38 +02:00
parent 3bed1cc3ea
commit bafc0a9d16

View File

@ -134,8 +134,10 @@ class Interpreter {
// enough for a single Pull.
constexpr size_t stack_size = 256 * 1024;
char stack_data[stack_size];
utils::MonotonicBufferResource memory(&stack_data[0], stack_size);
ctx_.evaluation_context.memory = &memory;
utils::MonotonicBufferResource monotonic_memory(&stack_data[0], stack_size);
// TODO (mferencevic): Tune the parameters accordingly.
utils::PoolResource pool_memory(128, 1024, &monotonic_memory);
ctx_.evaluation_context.memory = &pool_memory;
// We can now Pull a result.
bool return_value = cursor_->Pull(frame_, ctx_);
if (return_value && !output_symbols_.empty()) {