Skip to content

Commit

Permalink
Merge pull request #627 from samueldr/hydra-eval-jobs/warn-max-heap-size
Browse files Browse the repository at this point in the history
hydra-eval-jobs: Warn and resets maxHeapSize on bad values
  • Loading branch information
grahamc committed Mar 17, 2019
2 parents 44e7f0d + dd188d3 commit 0721f66
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/hydra-eval-jobs/hydra-eval-jobs.cc
Expand Up @@ -234,6 +234,18 @@ int main(int argc, char * * argv)
initNix();
initGC();

/* Read the current heap size, which is the initial heap size. */
GC_prof_stats_s gc;
GC_get_prof_stats(&gc, sizeof(gc));
auto initialHeapSizeInt = gc.heapsize_full;

/* Then make sure the maximum heap size will be bigger than the initial heap size. */
if (initialHeapSizeInt > maxHeapSize) {
printInfo("warning: evaluator_initial_heap_size (%d) bigger than evaluator_max_heap_size (%d).", initialHeapSizeInt, maxHeapSize);
maxHeapSize = initialHeapSizeInt * 1.1;
printInfo(" evaluator_max_heap_size now set to %d.", maxHeapSize);
}

Path releaseExpr;

struct MyArgs : LegacyArgs, MixEvalArgs
Expand Down

0 comments on commit 0721f66

Please sign in to comment.