Skip to content

Commit 641ddc5

Browse files
li1RAI CI (GitHub Action Automation)
authored andcommitted
Add GC metric last_incremental_sweep (JuliaLang#50190)
* Add GC metric `last_incremental_sweep` * Update gc.c * Update gc.c
1 parent f49dc78 commit 641ddc5

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

base/timing.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct GC_Num
2525
total_sweep_time ::Int64
2626
total_mark_time ::Int64
2727
last_full_sweep ::Int64
28+
last_incremental_sweep ::Int64
2829
end
2930

3031
gc_num() = ccall(:jl_gc_num, GC_Num, ())

src/gc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3302,6 +3302,9 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
33023302
if (sweep_full) {
33033303
gc_num.last_full_sweep = gc_end_time;
33043304
}
3305+
else {
3306+
gc_num.last_incremental_sweep = gc_end_time;
3307+
}
33053308

33063309
size_t heap_size = jl_atomic_load_relaxed(&gc_heap_stats.heap_size);
33073310
double target_allocs = 0.0;

src/gc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ typedef struct {
8383
uint64_t total_sweep_time;
8484
uint64_t total_mark_time;
8585
uint64_t last_full_sweep;
86+
uint64_t last_incremental_sweep;
8687
} jl_gc_num_t;
8788

8889
// Array chunks (work items representing suffixes of

0 commit comments

Comments
 (0)