Skip to content

Commit

Permalink
Merge memory usage tracker into memory pool (#19434)
Browse files Browse the repository at this point in the history
Summary:
X-link: prestodb/presto#19434

- Merge the logic of memory usage tracker into memory pool and provide an
   option to disable it from the root memory pool
- Simplify the memory exceeded error message generation
- Cover the memory usage tracker tests in memory pool test
- Remove the unused external memory reservation support which is previously
   added for Prestissimo

Pull Request resolved: #4642

Test Plan:
DPP test passed in five consecutive runs:
f429919614
f429919571
f429919606
f429919595
f429919583

Has run on T10_5 test cluster overnight

Reviewed By: oerling

Differential Revision: D45061393

Pulled By: xiaoxmeng

fbshipit-source-id: 00dd5b7ffcbedade8fe7278cdb3bce6739c40edf
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed Apr 21, 2023
1 parent ed40032 commit e5c36ae
Show file tree
Hide file tree
Showing 41 changed files with 1,644 additions and 2,529 deletions.
6 changes: 6 additions & 0 deletions velox/buffer/tests/BufferTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

DECLARE_bool(velox_enable_memory_usage_track_in_default_memory_pool);

namespace facebook {
namespace velox {

Expand All @@ -40,6 +42,10 @@ static_assert(!Buffer::is_pod_like_v<std::shared_ptr<int>>, "");

class BufferTest : public testing::Test {
protected:
static void SetUpTestCase() {
FLAGS_velox_enable_memory_usage_track_in_default_memory_pool = true;
}

void SetUp() override {
pool_ = memoryManager_.addLeafPool("BufferTest");
}
Expand Down
2 changes: 0 additions & 2 deletions velox/common/memory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ add_library(
MemoryAllocator.cpp
MemoryArbitrator.cpp
MemoryPool.cpp
MemoryUsage.cpp
MmapAllocator.cpp
MmapArena.cpp
MemoryUsageTracker.cpp
StreamArena.cpp)

target_link_libraries(
Expand Down
1 change: 0 additions & 1 deletion velox/common/memory/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "velox/common/memory/Allocation.h"
#include "velox/common/memory/MemoryAllocator.h"
#include "velox/common/memory/MemoryPool.h"
#include "velox/common/memory/MemoryUsage.h"

DECLARE_int32(memory_usage_aggregation_interval_millis);
DECLARE_bool(velox_memory_leak_check_enabled);
Expand Down
1 change: 0 additions & 1 deletion velox/common/memory/MemoryAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "velox/common/base/CheckedArithmetic.h"
#include "velox/common/base/Exceptions.h"
#include "velox/common/memory/Allocation.h"
#include "velox/common/memory/MemoryUsageTracker.h"
#include "velox/common/time/Timer.h"

DECLARE_bool(velox_use_malloc);
Expand Down
Loading

0 comments on commit e5c36ae

Please sign in to comment.