|
2 | 2 |
|
3 | 3 | # This type must be kept in sync with the C struct in src/gc-interface.h |
4 | 4 | struct GC_Num |
5 | | - allocd ::Int64 # GC internal |
6 | | - deferred_alloc ::Int64 # GC internal |
7 | | - freed ::Int64 # GC internal |
8 | | - malloc ::Int64 |
9 | | - realloc ::Int64 |
10 | | - poolalloc ::Int64 |
11 | | - bigalloc ::Int64 |
12 | | - freecall ::Int64 |
13 | | - total_time ::Int64 |
14 | | - total_allocd ::Int64 # GC internal |
15 | | - collect ::Csize_t # GC internal |
16 | | - pause ::Cint |
17 | | - full_sweep ::Cint |
18 | | - max_pause ::Int64 |
19 | | - max_memory ::Int64 |
20 | | - time_to_safepoint ::Int64 |
21 | | - max_time_to_safepoint ::Int64 |
22 | | - total_time_to_safepoint ::Int64 |
23 | | - sweep_time ::Int64 |
24 | | - mark_time ::Int64 |
25 | | - stack_pool_sweep_time ::Int64 |
26 | | - total_sweep_time ::Int64 |
27 | | - total_sweep_page_walk_time ::Int64 |
28 | | - total_sweep_madvise_time ::Int64 |
29 | | - total_sweep_free_mallocd_memory_time ::Int64 |
30 | | - total_mark_time ::Int64 |
| 5 | + # (GC Internal) Number of allocated bytes since the last collection. This field is reset |
| 6 | + # after the end of every garbage collection cycle, so it will always be zero if observed |
| 7 | + # during execution of Julia user code |
| 8 | + allocd::Int64 |
| 9 | + # (GC Internal) Number of allocated bytes within a `gc_disable/gc_enable` block. This field is |
| 10 | + # reset after every garbage collection cycle and will always be zero in case of no use |
| 11 | + # of `gc_disable/gc_enable` blocks |
| 12 | + deferred_alloc::Int64 |
| 13 | + # (GC Internal) Number of bytes freed bytes in the current collection cycle. This field is |
| 14 | + # reset after every garbage collection cycle and will always be zero when observed |
| 15 | + # during execution of Julia user code. It's incremented as memory is reclaimed during a collection, |
| 16 | + # used to gather some statistics within the collection itself and reset at the end of a GC cycle. |
| 17 | + freed::Int64 |
| 18 | + # Number of `malloc/calloc` calls (never reset by the runtime) |
| 19 | + malloc::Int64 |
| 20 | + # Number of `realloc` calls (never reset by the runtime) |
| 21 | + realloc::Int64 |
| 22 | + # Number of pool allocation calls (never reset by the runtime) |
| 23 | + # NOTE: Julia's stock GC uses an internal (pool) allocator for objects up to 2032 bytes. |
| 24 | + # Larger objects are allocated through `malloc/calloc`. |
| 25 | + poolalloc::Int64 |
| 26 | + # Number of allocations for "big objects" (non-array objects larger than 2032 bytes) |
| 27 | + # (never reset by the runtime) |
| 28 | + bigalloc::Int64 |
| 29 | + # Number of `free` calls (never reset by the runtime) |
| 30 | + freecall::Int64 |
| 31 | + # Total time spent in garbage collection (never reset by the runtime) |
| 32 | + total_time::Int64 |
| 33 | + # (GC internal) Total number of bytes allocated since the program started |
| 34 | + total_allocd::Int64 |
| 35 | + # (GC internal) Per-thread allocation quota before triggering a GC |
| 36 | + # NOTE: This field is no longer used by the heuristics in the stock GC |
| 37 | + interval::Csize_t |
| 38 | + # Duration of the last GC pause in nanoseconds |
| 39 | + pause::Cint |
| 40 | + # Number of full GC sweeps completed so far (never reset by the runtime) |
| 41 | + full_sweep::Cint |
| 42 | + # Maximum pause duration observed so far in nanoseconds |
| 43 | + max_pause::Int64 |
| 44 | + # Maximum number of bytes allocated any point in time. |
| 45 | + # NOTE: This is aggregated over objects, not pages |
| 46 | + max_memory::Int64 |
| 47 | + # Time taken to reach a safepoint in the last GC cycle in nanoseconds |
| 48 | + time_to_safepoint::Int64 |
| 49 | + # Maximum time taken to reach a safepoint across all GCs in nanoseconds |
| 50 | + max_time_to_safepoint::Int64 |
| 51 | + # Total time taken to reach safepoints across all GCs in nanoseconds |
| 52 | + total_time_to_safepoint::Int64 |
| 53 | + # Time spent in the last GC sweeping phase in nanoseconds |
| 54 | + sweep_time::Int64 |
| 55 | + # Time spent in the last GC marking phase in nanoseconds |
| 56 | + mark_time::Int64 |
| 57 | + # Time spent sweeping stack pools in the last GC in nanoseconds |
| 58 | + stack_pool_sweep_time::Int64 |
| 59 | + # Total time spent in sweeping phase across all GCs in nanoseconds |
| 60 | + total_sweep_time::Int64 |
| 61 | + # Total time spent walking pool allocated pages during sweeping phase across all GCs in nanoseconds |
| 62 | + total_sweep_page_walk_time::Int64 |
| 63 | + # Total time spent in madvise calls during sweeping phase across all GCs in nanoseconds |
| 64 | + total_sweep_madvise_time::Int64 |
| 65 | + # Total time spent in freeing malloc'd memory during sweeping phase across all GCs in nanoseconds |
| 66 | + total_sweep_free_mallocd_memory_time::Int64 |
| 67 | + # Total time spent in marking phase across all GCs in nanoseconds |
| 68 | + total_mark_time::Int64 |
| 69 | + # Total time spent sweeping stack pools across all GCs in nanoseconds |
31 | 70 | total_stack_pool_sweep_time::Int64 |
32 | | - last_full_sweep ::Int64 |
33 | | - last_incremental_sweep ::Int64 |
| 71 | + # Timestamp of the last full GC sweep in nanoseconds |
| 72 | + last_full_sweep::Int64 |
| 73 | + # Timestamp of the last incremental GC sweep in nanoseconds |
| 74 | + last_incremental_sweep::Int64 |
34 | 75 | end |
35 | 76 |
|
36 | 77 | gc_num() = ccall(:jl_gc_num, GC_Num, ()) |
|
0 commit comments