Skip to content

Commit 8da98df

Browse files
committed
implement recyle upon reaching max_worker_rss
1 parent cf7f953 commit 8da98df

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/runtests.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ else
118118
end
119119
end
120120

121+
#Always set the max rss so that if tests add large global variables (which they do) we don't make the GC's life too hard
122+
if Sys.WORD_SIZE == 64
123+
const JULIA_TEST_MAXRSS_MB = 3800
124+
else
125+
# Assume that we only have 3.5GB available to a single process, and that a single
126+
# test can take up to 2GB of RSS. This means that we should instruct the test
127+
# framework to restart any worker that comes into a test set with 1.5GB of RSS.
128+
const JULIA_TEST_MAXRSS_MB = 1536
129+
end
130+
131+
const max_worker_rss = JULIA_TEST_MAXRSS_MB * 2^20
132+
121133
# determine parallelism
122134
if !set_jobs
123135
jobs = Sys.CPU_THREADS
@@ -298,6 +310,11 @@ try
298310
p = recycle_worker(p)
299311
else
300312
print_testworker_stats(test, wrkr, resp)
313+
if resp[end] > max_worker_rss
314+
# the worker has reached the max-rss limit, recycle it
315+
# so future tests start with a smaller working set
316+
p = recycle_worker(p)
317+
end
301318
end
302319
end
303320

0 commit comments

Comments
 (0)