File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3206,7 +3206,11 @@ void jl_gc_init(void)
32063206
32073207#ifdef _P64
32083208 // on a big memory machine, set max_collect_interval to totalmem / ncores / 2
3209- size_t maxmem = uv_get_total_memory () / jl_cpu_threads () / 2 ;
3209+ uint64_t total_mem = uv_get_total_memory ();
3210+ uint64_t constrained_mem = uv_get_constrained_memory ();
3211+ if (constrained_mem > 0 && constrained_mem < total_mem )
3212+ total_mem = constrained_mem ;
3213+ size_t maxmem = total_mem / jl_cpu_threads () / 2 ;
32103214 if (maxmem > max_collect_interval )
32113215 max_collect_interval = maxmem ;
32123216#endif
Original file line number Diff line number Diff line change @@ -640,6 +640,9 @@ void _julia_init(JL_IMAGE_SEARCH rel)
640640
641641 jl_page_size = jl_getpagesize ();
642642 uint64_t total_mem = uv_get_total_memory ();
643+ uint64_t constrained_mem = uv_get_constrained_memory ();
644+ if (constrained_mem > 0 && constrained_mem < total_mem )
645+ total_mem = constrained_mem ;
643646 if (total_mem >= (size_t )-1 ) {
644647 total_mem = (size_t )-1 ;
645648 }
You can’t perform that action at this time.
0 commit comments