@@ -1391,21 +1391,19 @@ int jl_gc_classify_pools(size_t sz, int *osize)
13911391// sweep phase
13921392
13931393gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
1394+ JL_DLLEXPORT double jl_gc_page_utilization_stats [JL_GC_N_MAX_POOLS ];
13941395
13951396extern gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
13961397
13971398STATIC_INLINE void gc_update_page_fragmentation_data (jl_gc_pagemeta_t * pg ) JL_NOTSAFEPOINT
13981399{
1399- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14001400 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [pg -> pool_n ];
14011401 jl_atomic_fetch_add (& stats -> n_freed_objs , pg -> nfree );
14021402 jl_atomic_fetch_add (& stats -> n_pages_allocd , 1 );
1403- #endif
14041403}
14051404
14061405STATIC_INLINE void gc_dump_page_utilization_data (void ) JL_NOTSAFEPOINT
14071406{
1408- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14091407 for (int i = 0 ; i < JL_GC_N_POOLS ; i ++ ) {
14101408 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [i ];
14111409 double utilization = 1.0 ;
@@ -1414,12 +1412,10 @@ STATIC_INLINE void gc_dump_page_utilization_data(void) JL_NOTSAFEPOINT
14141412 if (n_pages_allocd != 0 ) {
14151413 utilization -= ((double )n_freed_objs * (double )jl_gc_sizeclasses [i ]) / (double )n_pages_allocd / (double )GC_PAGE_SZ ;
14161414 }
1417- jl_safe_printf ( "Size class %d: %.2f%% utilization\n" , jl_gc_sizeclasses [i ], utilization * 100.0 ) ;
1415+ jl_gc_page_utilization_stats [i ] = utilization ;
14181416 jl_atomic_store_relaxed (& stats -> n_freed_objs , 0 );
14191417 jl_atomic_store_relaxed (& stats -> n_pages_allocd , 0 );
14201418 }
1421- jl_safe_printf ("-----------------------------------------\n" );
1422- #endif
14231419}
14241420
14251421int64_t buffered_pages = 0 ;
0 commit comments