Skip to content

Commit f4ead3d

Browse files
author
Luis Eduardo de Souza Amorim
committed
Print utilization stats for stock GC
1 parent 5bd9e03 commit f4ead3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gc-stock.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,6 +3506,12 @@ JL_DLLEXPORT void jl_gc_collect(jl_gc_collection_t collection)
35063506
SetLastError(last_error);
35073507
#endif
35083508
errno = last_errno;
3509+
3510+
int64_t pool_live_bytes = jl_gc_pool_live_bytes();
3511+
int64_t pool_bytes_in_pages = jl_atomic_load_relaxed(&gc_heap_stats.bytes_resident);
3512+
jl_safe_printf("Utilization in pool allocator: %f, %lld live bytes and %lld bytes in pages\n",
3513+
(double)pool_live_bytes / (double)pool_bytes_in_pages,
3514+
(long long)pool_live_bytes, (long long)pool_bytes_in_pages);
35093515
}
35103516

35113517
void gc_mark_queue_all_roots(jl_ptls_t ptls, jl_gc_markqueue_t *mq)

0 commit comments

Comments
 (0)