void ObjectMemory::collect_mature_finish(STATE, GCData* data) {

    immix_->collect_finish(data);
    code_manager_.sweep();

    data->global_cache()->prune_unmarked(mark());

    prune_handles(data->handles(), data->cached_handles(), NULL);

    // Have to do this after all things that check for mark bits is
    // done, as it free()s objects, invalidating mark bits.
    mark_sweep_->after_marked();

    inflated_headers_->deallocate_headers(mark());

#ifdef RBX_GC_DEBUG
    immix_->verify(data);
#endif
    immix_->sweep();

    rotate_mark();

    gc_stats.full_collection_count++;
    if(FinalizerHandler* hdl = state->shared().finalizer_handler()) {
      hdl->finish_collection(state);
    }

    RUBINIUS_GC_END(1);
    young_autotune();
    young_gc_while_marking_ = 0;
  }
Beispiel #2
0
  void ObjectMemory::collect_mature_finish(STATE, GCData* data) {

    immix_->collect_finish(data);
    code_manager_.sweep();

    data->global_cache()->prune_unmarked(mark());

    prune_handles(data->handles(), data->cached_handles(), NULL);

    // Have to do this after all things that check for mark bits is
    // done, as it free()s objects, invalidating mark bits.
    mark_sweep_->after_marked();

    inflated_headers_->deallocate_headers(mark());

#ifdef RBX_GC_DEBUG
    immix_->verify(data);
#endif
    immix_->sweep();

    rotate_mark();

    metrics::MetricsData& metrics = state->vm()->metrics();
    metrics.m.ruby_metrics.gc_immix_count++;
    metrics.m.ruby_metrics.gc_large_count++;
    metrics.m.ruby_metrics.memory_immix_bytes = immix_->bytes_allocated();
    metrics.m.ruby_metrics.memory_large_bytes = mark_sweep_->allocated_bytes;
    metrics.m.ruby_metrics.memory_symbols_bytes = shared_.symbols.bytes_used();
    metrics.m.ruby_metrics.memory_code_bytes = code_manager_.size();
    metrics.m.ruby_metrics.memory_jit_bytes = data->jit_bytes_allocated();

    if(FinalizerThread* hdl = state->shared().finalizer_handler()) {
      hdl->finish_collection(state);
    }

    RUBINIUS_GC_END(1);
    young_autotune();
    young_gc_while_marking_ = 0;
  }