Skip to content

Commit a4a6395

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 5334aa2 commit a4a6395

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
@@ -3408,6 +3408,9 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
34083408
if (sweep_full) {
34093409
gc_num.last_full_sweep = gc_end_time;
34103410
}
3411+
else {
3412+
gc_num.last_incremental_sweep = gc_end_time;
3413+
}
34113414

34123415
// sweeping is over
34133416
// 7. if it is a quick sweep, put back the remembered objects in queued state

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)