diff --git a/base/timing.jl b/base/timing.jl index 0afe65227d4a4..3e1f3a3451149 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -12,7 +12,6 @@ struct GC_Num freecall ::Int64 total_time ::Int64 total_allocd ::Int64 # GC internal - since_sweep ::Int64 # GC internal collect ::Csize_t # GC internal pause ::Cint full_sweep ::Cint diff --git a/src/gc.c b/src/gc.c index 1cbcff5b50ab8..eea983b72ab70 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3184,7 +3184,6 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) mark_reset_age = 0; } - gc_num.since_sweep += gc_num.allocd; JL_PROBE_GC_MARK_END(scanned_bytes, perm_scanned_bytes); gc_settime_premark_end(); gc_time_mark_pause(gc_start_time, scanned_bytes, perm_scanned_bytes); @@ -3192,14 +3191,14 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) uint64_t mark_time = end_mark_time - start_mark_time; gc_num.mark_time = mark_time; gc_num.total_mark_time += mark_time; - int64_t actual_allocd = gc_num.since_sweep; + int64_t allocd = gc_num.allocd; gc_settime_postmark_end(); // marking is over // Flush everything in mark cache gc_sync_all_caches_nolock(ptls); - int64_t live_sz_ub = live_bytes + actual_allocd; + int64_t live_sz_ub = live_bytes + allocd; int64_t live_sz_est = scanned_bytes + perm_scanned_bytes; int64_t estimate_freed = live_sz_ub - live_sz_est; @@ -3209,11 +3208,11 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) gc_stats_big_obj(); objprofile_printall(); objprofile_reset(); - gc_num.total_allocd += gc_num.since_sweep; + gc_num.total_allocd += gc_num.allocd; if (!prev_sweep_full) promoted_bytes += perm_scanned_bytes - last_perm_scanned_bytes; // 5. next collection decision - int not_freed_enough = (collection == JL_GC_AUTO) && estimate_freed < (7*(actual_allocd/10)); + int not_freed_enough = (collection == JL_GC_AUTO) && estimate_freed < (7*(allocd/10)); int nptr = 0; assert(gc_n_threads); for (int i = 0; i < gc_n_threads; i++) { @@ -3334,7 +3333,7 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) _report_gc_finished(pause, gc_num.freed, sweep_full, recollect); gc_final_pause_end(gc_start_time, gc_end_time); - gc_time_sweep_pause(gc_end_time, actual_allocd, live_bytes, + gc_time_sweep_pause(gc_end_time, allocd, live_bytes, estimate_freed, sweep_full); gc_num.full_sweep += sweep_full; uint64_t max_memory = last_live_bytes + gc_num.allocd; @@ -3342,9 +3341,8 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) gc_num.max_memory = max_memory; } - gc_num.allocd = 0; last_live_bytes = live_bytes; - live_bytes += -gc_num.freed + gc_num.since_sweep; + live_bytes += -gc_num.freed + gc_num.allocd; if (collection == JL_GC_AUTO) { //If we aren't freeing enough or are seeing lots and lots of pointers let it increase faster @@ -3386,7 +3384,7 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) prev_sweep_full = sweep_full; gc_num.pause += !recollect; gc_num.total_time += pause; - gc_num.since_sweep = 0; + gc_num.allocd = 0; gc_num.freed = 0; if (pause > gc_num.max_pause) { gc_num.max_pause = pause; diff --git a/src/gc.h b/src/gc.h index 3d5328c525e98..eb20dd0ac36f6 100644 --- a/src/gc.h +++ b/src/gc.h @@ -69,7 +69,6 @@ typedef struct { uint64_t freecall; uint64_t total_time; uint64_t total_allocd; - uint64_t since_sweep; size_t interval; int pause; int full_sweep;