From 7831492132ac3726ee0886d4dd0e7a9bfb5c73ed Mon Sep 17 00:00:00 2001 From: Ji Hwan Kim Date: Tue, 9 Apr 2024 15:29:36 +0800 Subject: [PATCH] feature: add warning for executor cache config --- src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 2458499d7..d44dbfaf9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "goldilocks_base_field.hpp" #include "utils.hpp" #include "config.hpp" @@ -574,6 +575,12 @@ int main(int argc, char **argv) ExecutorServer *pExecutorServer = NULL; if (config.runExecutorServer) { + struct sysinfo sysInfo; + // If configured executor is using more than 50% of available system memory, output warning. + if ( (config.dbProgramCacheSize + config.dbMTCacheSize) > (0.5 * sysInfo.totalram / 1048576) ) + { + zklog.warning("Available system memory may not be enough for the configured option. Try reducing the dbMTCacheSize, or dbProgramCacheSize in case of OOM..."); + } pExecutorServer = new ExecutorServer(fr, prover, config); zkassert(pExecutorServer != NULL); zklog.info("Launching executor server thread...");