Skip to content

Commit

Permalink
feature: add warning for executor cache config
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkimqd committed Apr 16, 2024
1 parent 93c36f1 commit 7831492
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <fstream>
#include <iomanip>
#include <sys/time.h>
#include <sys/sysinfo.h>
#include "goldilocks_base_field.hpp"
#include "utils.hpp"
#include "config.hpp"
Expand Down Expand Up @@ -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...");
Expand Down

0 comments on commit 7831492

Please sign in to comment.