summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 05:55:05 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 05:55:05 +0000
commit8398719020b56bbd38bad72c894dd21d2aff6de9 (patch)
tree30ea1320936de379a4c22ffbc3c176e869529b3e /gc.c
parent79031be8803e17a375fe72e7c7c6028771e672f8 (diff)
* gc.c: fix to use total_allocated_object_num and heaps_used
at the GC time for profiler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/gc.c b/gc.c
index 659b0bac9d..6f5ccec468 100644
--- a/gc.c
+++ b/gc.c
@@ -126,7 +126,7 @@ void rb_gcdebug_print_obj_condition(VALUE obj);
* 3: show all references
*/
#ifndef RGENGC_CHECK_MODE
-#define RGENGC_CHECK_MODE 0
+#define RGENGC_CHECK_MODE 2
#endif
/* RGENGC_PROFILE
@@ -135,7 +135,7 @@ void rb_gcdebug_print_obj_condition(VALUE obj);
* 2: enable profiling for each types
*/
#ifndef RGENGC_PROFILE
-#define RGENGC_PROFILE 0
+#define RGENGC_PROFILE 1
#endif
#else /* USE_RGENGC */
@@ -145,10 +145,10 @@ void rb_gcdebug_print_obj_condition(VALUE obj);
#endif
#ifndef GC_PROFILE_MORE_DETAIL
-#define GC_PROFILE_MORE_DETAIL 0
+#define GC_PROFILE_MORE_DETAIL 1
#endif
#ifndef GC_ENABLE_LAZY_SWEEP
-#define GC_ENABLE_LAZY_SWEEP 0
+#define GC_ENABLE_LAZY_SWEEP 1
#endif
#ifndef CALC_EXACT_MALLOC_SIZE
#define CALC_EXACT_MALLOC_SIZE 0
@@ -3553,12 +3553,19 @@ gc_marks_test(rb_objspace_t *objspace, bits_t *before_stored_bitmaps)
{
bits_t *stored_bitmaps = gc_store_bitmaps(objspace);
size_t i;
+ size_t stored_oldgen, stored_shady;
rgengc_report(1, objspace, "gc_marks_test: test-full-gc\n");
/* run major (full) gc with temporary mark/rememberset */
- gc_marks_body(objspace, FALSE);
+ stored_oldgen = objspace->rgengc.oldgen_object_count;
+ stored_shady = objspace->rgengc.remembered_shady_object_count;
+ {
+ gc_marks_body(objspace, FALSE);
+ }
objspace->rgengc.during_minor_gc = TRUE;
+ objspace->rgengc.oldgen_object_count = stored_oldgen;
+ objspace->rgengc.remembered_shady_object_count = stored_shady;
/* check */
for (i=0; i<heaps_used; i++) {
@@ -5061,12 +5068,14 @@ gc_prof_sweep_timer_start(rb_objspace_t *objspace)
static inline void
gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
{
+ fprintf(stderr, "gc_prof_sweep_timer_stop!!\n");
+
if (RUBY_DTRACE_GC_SWEEP_END_ENABLED()) {
RUBY_DTRACE_GC_SWEEP_END();
}
+
if (objspace->profile.run) {
double sweep_time;
-
gc_profile_record *record = gc_prof_record(objspace);
if (record->gc_time > 0) {
@@ -5078,6 +5087,8 @@ gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
sweep_time = elapsed_time_from(objspace->profile.gc_sweep_start_time);
}
+ fprintf(stderr, "sweep_time: %g\n", sweep_time);
+
#if GC_PROFILE_MORE_DETAIL
record->gc_sweep_time += sweep_time;
if (deferred_final_list) record->flags |= GPR_FLAG_HAVE_FINALIZE;