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...");