From 7c5da018f0dac6410f74a370af5b4976d653d8f4 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 2458499d7..734a5c4c6 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,13 @@ int main(int argc, char **argv) ExecutorServer *pExecutorServer = NULL; if (config.runExecutorServer) { + struct sysinfo sysInfo; + int64_t totalRam = sysInfo.totalram / 1048576 + // If configured executor is using more than 50% of available system memory, output warning. + if ( (config.dbProgramCacheSize + config.dbMTCacheSize) > (0.5 * totalRam) ) + { + zklog.warning("Available system memory (" + (totalRam) + ")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...");