diff --git a/ChangeLog b/ChangeLog index d4bb45be4c..e203d1635c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri May 16 17:38:22 2014 Koichi Sasada + + * gc.c (gc_marks, gc_marks_body): increase the counter of young objects + at the major GC because AGE2Promotion changes all old objects into + young objects at major GC. + Fri May 16 17:26:24 2014 Koichi Sasada * gc.c (gc_before_sweep): heap_pages_swept_slots should contains diff --git a/gc.c b/gc.c index fd0a90d724..220c63af81 100644 --- a/gc.c +++ b/gc.c @@ -4210,6 +4210,12 @@ gc_marks_body(rb_objspace_t *objspace, int full_mark) } else { objspace->profile.major_gc_count++; +#if RGENGC_AGE2_PROMOTION + /* all old objects change to young objects */ + objspace->rgengc.young_object_count += objspace->rgengc.old_object_count; +#endif + objspace->rgengc.remembered_shady_object_count = 0; + objspace->rgengc.old_object_count = 0; rgengc_mark_and_rememberset_clear(objspace, heap_eden); } #endif @@ -4570,9 +4576,6 @@ gc_marks(rb_objspace_t *objspace, int full_mark) gc_verify_internal_consistency(Qnil); #endif if (full_mark == TRUE) { /* major/full GC */ - objspace->rgengc.remembered_shady_object_count = 0; - objspace->rgengc.old_object_count = 0; - gc_marks_body(objspace, TRUE); { /* See the comment about RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR */