Skip to content

Commit

Permalink
[native] Add system-memory-pushback-by-abort-enabled config
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjialiang committed Mar 13, 2024
1 parent 4443691 commit bacf9c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Configs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ SystemConfig::SystemConfig() {
NUM_PROP(kSystemMemLimitGb, 55),
NUM_PROP(kSystemMemShrinkGb, 8),
BOOL_PROP(kMallocMemHeapDumpEnabled, false),
BOOL_PROP(kSystemMemPushbackAbortEnabled, false),
NUM_PROP(kMallocHeapDumpThresholdGb, 20),
NUM_PROP(kMallocMemMinHeapDumpInterval, 10),
NUM_PROP(kMallocMemMaxHeapDumpFiles, 5),
Expand Down Expand Up @@ -389,6 +390,10 @@ bool SystemConfig::systemMemPushbackEnabled() const {
return optionalProperty<bool>(kSystemMemPushbackEnabled).value();
}

bool SystemConfig::systemMemPushBackAbortEnabled() const {
return optionalProperty<bool>(kSystemMemPushbackAbortEnabled).value();
}

bool SystemConfig::mallocMemHeapDumpEnabled() const {
return optionalProperty<bool>(kMallocMemHeapDumpEnabled).value();
}
Expand Down
7 changes: 7 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ class SystemConfig : public ConfigBase {
/// get the server out of low memory condition. This only applies if
/// 'system-mem-pushback-enabled' is true.
static constexpr std::string_view kSystemMemShrinkGb{"system-mem-shrink-gb"};
/// If true, memory pushback will quickly abort queries with the most memory
/// usage under low memory condition. This only applies if
/// 'system-mem-pushback-enabled' is set.
static constexpr std::string_view kSystemMemPushbackAbortEnabled{
"system-mem-pushback-abort-enabled"};

/// If true, memory allocated via malloc is periodically checked and a heap
/// profile is dumped if usage exceeds 'malloc-heap-dump-gb-threshold'.
Expand Down Expand Up @@ -579,6 +584,8 @@ class SystemConfig : public ConfigBase {

uint32_t systemMemShrinkGb() const;

bool systemMemPushBackAbortEnabled() const;

bool mallocMemHeapDumpEnabled() const;

uint32_t mallocHeapDumpThresholdGb() const;
Expand Down

0 comments on commit bacf9c3

Please sign in to comment.