Top


定義場所(file name)

hotspot/src/share/vm/memory/genCollectedHeap.cpp

説明(description)

// this is the private collection interface
// The Heap_lock is expected to be held on entry.

名前(function name)

void GenCollectedHeap::collect_locked(GCCause::Cause cause, int max_level) {

本体部(body)

  {- -------------------------------------------
  (1) ヒープダンプを作成する場合 (= DumpSharedSpaces オプションが指定されている場合) は, 
      GC を実行してはまずいので report_out_of_shared_space() を呼んで強制終了する.
      (なお, _preloading_shared_classes はヒープダンプを作成する場合にのみ true となる
       (See: GenCollectedHeap::preload_and_dump()))
      ---------------------------------------- -}

      if (_preloading_shared_classes) {
        report_out_of_shared_space(SharedPermGen);
      }

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      // Read the GC count while holding the Heap_lock
      unsigned int gc_count_before      = total_collections();
      unsigned int full_gc_count_before = total_full_collections();

  {- -------------------------------------------
  (1) VM_GenCollectFull による GC を実行する.
      ---------------------------------------- -}

      {
        MutexUnlocker mu(Heap_lock);  // give up heap lock, execute gets it back
        VM_GenCollectFull op(gc_count_before, full_gc_count_before,
                             cause, max_level);
        VMThread::execute(&op);
      }
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.