Top


定義場所(file name)

hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp

名前(function name)

void VM_GC_HeapInspection::doit() {

本体部(body)

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

      HandleMark hm;
      CollectedHeap* ch = Universe::heap();

  {- -------------------------------------------
  (1) 
      ---------------------------------------- -}

      ch->ensure_parsability(false); // must happen, even if collection does
                                     // not happen (e.g. due to GC_locker)

  {- -------------------------------------------
  (1) Full GC が要求されていれば (= _full_gc コンストラクタ引数が true であれば), 
      CollectedHeap::collect_as_vm_thread() で Full GC を実行する.
      ---------------------------------------- -}

      if (_full_gc) {
        // The collection attempt below would be skipped anyway if
        // the gc locker is held. The following dump may then be a tad
        // misleading to someone expecting only live objects to show
        // up in the dump (see CR 6944195). Just issue a suitable warning
        // in that case and do not attempt to do a collection.
        // The latter is a subtle point, because even a failed attempt
        // to GC will, in fact, induce one in the future, which we
        // probably want to avoid in this case because the GC that we may
        // be about to attempt holds value for us only
        // if it happens now and not if it happens in the eventual
        // future.
        if (GC_locker::is_active()) {
          warning("GC locker is held; pre-dump GC was skipped");
        } else {
          ch->collect_as_vm_thread(GCCause::_heap_inspection);
        }
      }

  {- -------------------------------------------
  (1) HeapInspection::heap_inspection() を呼び出して, 
      「ヒープ内にどのクラスのインスタンスがどれだけ(何個および何バイト)存在しているか」という情報を出力する.
      ---------------------------------------- -}

      HeapInspection::heap_inspection(_out, _need_prologue /* need_prologue */);
    }

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