Skip to content

Commit 951eb3d

Browse files
committed
remove last_live_bytes global variable to simplify GC metrics code a bit
1 parent 4060c45 commit 951eb3d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/gc-stock.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ int under_pressure = 0;
205205
// Full collection heuristics
206206
static int64_t live_bytes = 0;
207207
static int64_t promoted_bytes = 0;
208-
static int64_t last_live_bytes = 0; // live_bytes at last collection
209208
#ifdef __GLIBC__
210209
// maxrss at last malloc_trim
211210
static int64_t last_trim_maxrss = 0;
@@ -3362,15 +3361,14 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) JL_NOTS
33623361
#endif
33633362

33643363
_report_gc_finished(pause, gc_num.freed, sweep_full, recollect, live_bytes);
3365-
uint64_t max_memory = last_live_bytes + gc_num.allocd;
3364+
uint64_t max_memory = live_bytes + gc_num.allocd;
33663365
if (max_memory > gc_num.max_memory) {
33673366
gc_num.max_memory = max_memory;
33683367
}
33693368
gc_final_pause_end(gc_start_time, gc_end_time);
33703369
gc_time_sweep_pause(gc_end_time, gc_num.allocd, live_bytes,
33713370
gc_num.freed, sweep_full);
33723371
gc_num.full_sweep += sweep_full;
3373-
last_live_bytes = live_bytes;
33743372
live_bytes += -gc_num.freed + gc_num.allocd;
33753373
jl_timing_counter_dec(JL_TIMING_COUNTER_HeapSize, gc_num.freed);
33763374

0 commit comments

Comments
 (0)