Skip to content

Commit

Permalink
Changed back to start() to override from PeriodicMemoryChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
minhancao committed Feb 6, 2025
1 parent 049d519 commit e132fbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class LinuxMemoryChecker : public PeriodicMemoryChecker {
PRESTO_STARTUP_LOG(INFO)
<< fmt::format("Could not find memory max file: {}", memMaxFile_);
}

checkMemoryConfigs();
}

~LinuxMemoryChecker() override {}
Expand All @@ -86,7 +84,7 @@ class LinuxMemoryChecker : public PeriodicMemoryChecker {
LOG(INFO) << fmt::format("Changed to using meminfo file {}", memInfoFile_);
}

void checkMemoryConfigs() {
void start() override {
// Check system-memory-gb < system-mem-limit-gb < actual total memory
// capacity.
auto* systemConfig = SystemConfig::instance();
Expand All @@ -112,6 +110,8 @@ class LinuxMemoryChecker : public PeriodicMemoryChecker {
LOG(WARNING) << "system-mem-limit-gb is smaller than system-memory-gb. "
<< "Expected: system-mem-limit-gb >= system-memory-gb.";
}

PeriodicMemoryChecker::start();
}

int64_t getActualTotalMemory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ class PeriodicMemoryChecker {

/// Starts the 'PeriodicMemoryChecker'. A background scheduler will be
/// launched to perform the checks. This should only be called once.
void start();
virtual void start();

/// Stops the 'PeriodicMemoryChecker'.
void stop();
virtual void stop();

protected:
/// Returns current system memory usage. The returned value is used to compare
Expand Down

0 comments on commit e132fbc

Please sign in to comment.