File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1057,8 +1057,10 @@ static bigval_t **sweep_big_list(int sweep_full, bigval_t **pv) JL_NOTSAFEPOINT
1057
1057
if (nxt )
1058
1058
nxt -> prev = pv ;
1059
1059
gc_num .freed += v -> sz & ~3 ;
1060
- jl_atomic_fetch_add_relaxed (& gc_heap_stats .malloc_bytes_freed , v -> sz & ~3 );
1061
- jl_atomic_fetch_add_relaxed (& gc_heap_stats .heap_size , - (v -> sz & ~3 ));
1060
+ jl_atomic_store_relaxed (& gc_heap_stats .malloc_bytes_freed ,
1061
+ jl_atomic_load_relaxed (& gc_heap_stats .malloc_bytes_freed ) + (v -> sz & ~3 ));
1062
+ jl_atomic_store_relaxed (& gc_heap_stats .heap_size ,
1063
+ jl_atomic_load_relaxed (& gc_heap_stats .heap_size ) - (v -> sz & ~3 ));
1062
1064
#ifdef MEMDEBUG
1063
1065
memset (v , 0xbb , v -> sz & ~3 );
1064
1066
#endif
@@ -1194,6 +1196,10 @@ static void jl_gc_free_array(jl_array_t *a) JL_NOTSAFEPOINT
1194
1196
jl_free_aligned (d );
1195
1197
else
1196
1198
free (d );
1199
+ jl_atomic_store_relaxed (& gc_heap_stats .malloc_bytes_freed ,
1200
+ jl_atomic_load_relaxed (& gc_heap_stats .malloc_bytes_freed ) + jl_array_nbytes (a ));
1201
+ jl_atomic_store_relaxed (& gc_heap_stats .heap_size ,
1202
+ jl_atomic_load_relaxed (& gc_heap_stats .heap_size ) - jl_array_nbytes (a ));
1197
1203
jl_atomic_fetch_add_relaxed (& gc_heap_stats .malloc_bytes_freed , jl_array_nbytes (a ));
1198
1204
jl_atomic_fetch_add_relaxed (& gc_heap_stats .heap_size , - jl_array_nbytes (a ));
1199
1205
gc_num .freed += jl_array_nbytes (a );
Original file line number Diff line number Diff line change @@ -37,6 +37,15 @@ if !@isdefined(testenv_defined)
37
37
38
38
function addprocs_with_testenv (X; rr_allowed= true , kwargs... )
39
39
exename = rr_allowed ? ` $rr_exename $test_exename ` : test_exename
40
+ if X isa Integer
41
+ if Sys. iswindows ()
42
+ heap_size= round (Int,(Sys. free_memory ()/ (1024 ^ 2 )/ (X+ 1 )))
43
+ heap_size -= 300 # I don't know anymore
44
+ else
45
+ heap_size= round (Int,(Sys. total_memory ()/ (1024 ^ 2 )/ (X+ 1 )))
46
+ end
47
+ push! (test_exeflags. exec, " --heap-size-hint=$(heap_size) M" )
48
+ end
40
49
addprocs (X; exename= exename, exeflags= test_exeflags, kwargs... )
41
50
end
42
51
You can’t perform that action at this time.
0 commit comments