}
void
-sgen_client_log_timing (GGTimingInfo *info, mword last_major_num_sections, mword last_los_memory_usage)
+sgen_client_log_timing (GGTimingInfo *info, mword promoted_size, mword last_los_memory_usage)
{
SgenMajorCollector *major_collector = sgen_get_major_collector ();
mword num_major_sections = major_collector->get_num_major_sections ();
info->reason ? info->reason : "",
(int)info->total_time / 10000.0f,
full_timing_buff,
- (num_major_sections - last_major_num_sections) * major_collector->section_size / 1024,
+ (int)promoted_size / 1024,
major_collector->section_size * num_major_sections / 1024,
los_memory_usage / 1024);
}
* Called after collections, reporting the amount of time they took. No action is
* necessary.
*/
-void sgen_client_log_timing (GGTimingInfo *info, mword last_major_num_sections, mword last_los_memory_usage);
+void sgen_client_log_timing (GGTimingInfo *info, mword promoted_size, mword last_los_memory_usage);
/*
* Called to handle `MONO_GC_PARAMS` and `MONO_GC_DEBUG` options. The `handle` functions
extern guint32 tlab_size;
extern NurseryClearPolicy nursery_clear_policy;
extern gboolean sgen_try_free_some_memory;
+extern mword total_promoted_size;
extern MonoCoopMutex gc_mutex;
#define MIN_MINOR_COLLECTION_ALLOWANCE ((mword)(DEFAULT_NURSERY_SIZE * default_allowance_nursery_size_ratio))
+mword total_promoted_size = 0;
+static mword total_promoted_size_start;
+
/*Heap limits and allocation knobs*/
static mword max_heap_size = ((mword)0)- ((mword)1);
static mword soft_heap_limit = ((mword)0) - ((mword)1);
void
sgen_memgov_minor_collection_start (void)
{
+ total_promoted_size_start = total_promoted_size;
}
void
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_los_memory_usage);
}
last_los_memory_usage = los_memory_usage;
}
static inline GCObject*
alloc_for_promotion (GCVTable vtable, GCObject *obj, size_t objsize, gboolean has_references)
{
+ total_promoted_size += objsize;
return major_collector.alloc_object (vtable, objsize, has_references);
}
int age;
age = get_object_age (obj);
- if (age >= promote_age)
+ if (age >= promote_age) {
+ total_promoted_size += objsize;
return major_collector.alloc_object (vtable, objsize, has_references);
+ }
/* Promote! */
++age;
age_alloc_buffers [age].next += objsize;
} else {
p = alloc_for_promotion_slow_path (age, objsize);
- if (!p)
+ if (!p) {
+ total_promoted_size += objsize;
return major_collector.alloc_object (vtable, objsize, has_references);
+ }
}
/* FIXME: assumes object layout */