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 7c5da01
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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,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...");
Expand Down

0 comments on commit 7c5da01

Please sign in to comment.