diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-20 22:38:08 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-20 22:38:08 +0000 |
commit | 8ab7d0e4c3c19688736c874e17a85c32124dbd88 (patch) | |
tree | 73b2a059a053759512fd8d9af664a63fe0345d00 | |
parent | 42a086502b8dbb7a29eb84cae5f99f0f69fe20c9 (diff) | |
download | ruby-8ab7d0e4c3c19688736c874e17a85c32124dbd88.tar.gz |
* gc.c (gc_profile_record::oldgen_objects): added.
* gc.c (gc_profile_dump_on): print the following infomation:
* Living object counts
* Free object counts
If RGENGC_PROFILE > 0 then
* Oldgen object counts
* Remembered normal object counts
* Remembered shady object counts
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | gc.c | 32 |
2 files changed, 40 insertions, 4 deletions
@@ -1,3 +1,15 @@ +Fri Jun 21 07:34:47 2013 Koichi Sasada <ko1@atdot.net> + + * gc.c (gc_profile_record::oldgen_objects): added. + + * gc.c (gc_profile_dump_on): print the following infomation: + * Living object counts + * Free object counts + If RGENGC_PROFILE > 0 then + * Oldgen object counts + * Remembered normal object counts + * Remembered shady object counts + Fri Jun 21 06:43:59 2013 Tanaka Akira <akr@fsij.org> * bignum.c (rb_ull2big): Refactored. @@ -148,7 +148,7 @@ void rb_gcdebug_print_obj_condition(VALUE obj); #define GC_PROFILE_MORE_DETAIL 0 #endif #ifndef GC_ENABLE_LAZY_SWEEP -#define GC_ENABLE_LAZY_SWEEP 1 +#define GC_ENABLE_LAZY_SWEEP 0 #endif #ifndef CALC_EXACT_MALLOC_SIZE #define CALC_EXACT_MALLOC_SIZE 0 @@ -197,6 +197,7 @@ typedef struct gc_profile_record { #endif #if RGENGC_PROFILE > 0 + size_t oldgen_objects; size_t remembered_normal_objects; size_t remembered_shady_objects; #endif @@ -5133,6 +5134,7 @@ gc_prof_set_heap_info(rb_objspace_t *objspace, gc_profile_record *record) #endif #if RGENGC_PROFILE > 0 + record->oldgen_objects = objspace->rgengc.oldgen_object_count; record->remembered_normal_objects = objspace->profile.remembered_normal_objects; record->remembered_shady_objects = objspace->profile.remembered_shady_objects; #endif @@ -5269,6 +5271,7 @@ gc_profile_record_get(void) #endif #if RGENGC_PROFILE > 0 + rb_hash_aset(prof, ID2SYM(rb_intern("OLDGEN_OBJECTS")), SIZET2NUM(objspace->profile.record[i].oldgen_objects)); rb_hash_aset(prof, ID2SYM(rb_intern("REMEMBED_NORMAL_OBJECTS")), SIZET2NUM(objspace->profile.record[i].remembered_normal_objects)); rb_hash_aset(prof, ID2SYM(rb_intern("REMEMBED_SHADY_OBJECTS")), SIZET2NUM(objspace->profile.record[i].remembered_shady_objects)); #endif @@ -5297,6 +5300,7 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE)) i+1, record->gc_invoke_time, record->heap_use_size, record->heap_total_size, record->heap_total_objects, record->gc_time*1000)); } + #if GC_PROFILE_MORE_DETAIL append(out, rb_str_new_cstr("\n\n" \ "More detail.\n" \ @@ -5305,14 +5309,24 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE)) #if CALC_EXACT_MALLOC_SIZE " Allocated Size" #endif - " Use Slot Mark Time(ms) Sweep Time(ms) Prepare Time(ms) Removing Obj. Empty Obj.\n")); + " Use Slot Mark Time(ms) Sweep Time(ms) Prepare Time(ms) LivingObj FreeObj RemovedObj EmptyObj" +#if RGENGC_PROFILE + " OldgenObj RemNormObj RemShadObj" +#endif + "\n")); + for (i = 0; i < count; i++) { record = &objspace->profile.record[i]; append(out, rb_sprintf("%5"PRIdSIZE" %c/%c/%6s%c %13"PRIuSIZE" %15"PRIuSIZE #if CALC_EXACT_MALLOC_SIZE " %15"PRIuSIZE #endif - " %9"PRIuSIZE" %17.12f %17.12f %17.12f %14"PRIuSIZE" %11"PRIuSIZE" \n", + " %9"PRIuSIZE" %17.12f %17.12f %17.12f %10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE +#if RGENGC_PROFILE + "%10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE"\n" +#endif + , + i+1, (record->flags & GPR_FLAG_MINOR) ? '-' : '+', (record->flags & GPR_FLAG_HAVE_FINALIZE) ? 'F' : '.', @@ -5326,10 +5340,20 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE)) record->allocated_size, #endif record->heap_use_slots, - record->gc_mark_time*1000, record->gc_sweep_time*1000, + record->gc_mark_time*1000, + record->gc_sweep_time*1000, record->prepare_time*1000, + + record->heap_live_objects, + record->heap_free_objects, record->removing_objects, record->empty_objects +#if RGENGC_PROFILE + , + record->oldgen_objects, + record->remembered_normal_objects, + record->remembered_shady_objects +#endif )); } #endif |