X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mono%2Fsgen%2Fsgen-memory-governor.c;h=4648d8d761d444cbb8b6ec411d6fff6d3d2ad4da;hb=2261009c646112df17270221e7cc78fdee72c9d6;hp=398c36e2ab24f9588638699b7c33bd548854b1f7;hpb=1c385f99e1c5e5c76e03c49e838ac29739a2e9e2;p=mono.git diff --git a/mono/sgen/sgen-memory-governor.c b/mono/sgen/sgen-memory-governor.c index 398c36e2ab2..4648d8d761d 100644 --- a/mono/sgen/sgen-memory-governor.c +++ b/mono/sgen/sgen-memory-governor.c @@ -25,6 +25,11 @@ #define MIN_MINOR_COLLECTION_ALLOWANCE ((mword)(DEFAULT_NURSERY_SIZE * default_allowance_nursery_size_ratio)) +mword total_promoted_size = 0; +mword total_allocated_major = 0; +static mword total_promoted_size_start; +static mword total_allocated_major_end; + /*Heap limits and allocation knobs*/ static mword max_heap_size = ((mword)0)- ((mword)1); static mword soft_heap_limit = ((mword)0) - ((mword)1); @@ -48,13 +53,11 @@ static mword major_collection_trigger_size; static mword major_pre_sweep_heap_size; static mword major_start_heap_size; -static mword last_major_num_sections = 0; -static mword last_los_memory_usage = 0; - static gboolean need_calculate_minor_collection_allowance; /* The size of the LOS after the last major collection, after sweeping. */ static mword last_collection_los_memory_usage = 0; +static mword last_used_slots_size = 0; static mword sgen_memgov_available_free_space (void); @@ -160,6 +163,7 @@ sgen_need_major_collection (mword space_needed) void sgen_memgov_minor_collection_start (void) { + total_promoted_size_start = total_promoted_size; } void @@ -178,6 +182,17 @@ sgen_memgov_major_pre_sweep (void) } } +void +sgen_memgov_major_post_sweep (mword used_slots_size) +{ + mword num_major_sections = major_collector.get_num_major_sections (); + + mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_SWEEP: major size: %dK in use: %dK", + num_major_sections * major_collector.section_size / 1024, + (used_slots_size + total_allocated_major - total_allocated_major_end) / 1024); + last_used_slots_size = used_slots_size; +} + void sgen_memgov_major_collection_start (void) { @@ -194,6 +209,7 @@ sgen_memgov_major_collection_end (gboolean forced) { last_collection_los_memory_usage = los_memory_usage; + total_allocated_major_end = total_allocated_major; if (forced) { sgen_get_major_collector ()->finish_sweeping (); sgen_memgov_calculate_minor_collection_allowance (); @@ -211,9 +227,8 @@ sgen_memgov_collection_end (int generation, GGTimingInfo* info, int info_count) int i; for (i = 0; i < info_count; ++i) { if (info[i].generation != -1) - sgen_client_log_timing (&info [i], last_major_num_sections, last_los_memory_usage); + sgen_client_log_timing (&info [i], total_promoted_size - total_promoted_size_start, last_used_slots_size + total_allocated_major - total_allocated_major_end); } - last_major_num_sections = major_collector.get_num_major_sections (); } /*