Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't call rb_gc_finalize_deferred "just in case".

  • Loading branch information...
commit 83fc22f0283d14d1494e43fc0694d2cd7bc11cb3 1 parent 5875c35
authored July 28, 2011

Showing 1 changed file with 0 additions and 2 deletions. Show diff stats Hide diff stats

  1. 2  eval.c
2  eval.c
@@ -5825,7 +5825,6 @@ eval_check_tick()
5825 5825
     if ((++tick & 0xff) == 0) {
5826 5826
         CHECK_INTS;             /* better than nothing */
5827 5827
         stack_check();
5828  
-        rb_gc_finalize_deferred();
5829 5828
     }
5830 5829
 }
5831 5830
 
@@ -11419,7 +11418,6 @@ rb_thread_schedule()
11419 11418
     }
11420 11419
 #endif
11421 11420
     rb_thread_pending = 0;
11422  
-    rb_gc_finalize_deferred();
11423 11421
     if (curr_thread == curr_thread->next
11424 11422
         && curr_thread->status == THREAD_RUNNABLE)
11425 11423
         return;

3 notes on commit 83fc22f

Evan Weaver
evan commented on 83fc22f July 29, 2011

This longstanding Ruby bug is only triggered in REE and friends, but leads to thread corruption.

Kiji calls rb_gc_finalize_deferred() after every eden collection, so there is no reason to randomly do it during evaluation context.

Dennis

This change caused the memory utilization for our spec runs to go from 1gb to 11gb. We had to back the change out because we were running out of memory.

Chehai

In order to fix the threading problem, you only need to remove rb_gc_finalize_deferred() on Line#11422. Calling rb_gc_finalize_deferred() every 256 ticks helps to release memory.

Please sign in to comment.
Something went wrong with that request. Please try again.