Top


定義場所(file name)

hotspot/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp

名前(function name)

void ThreadLocalAllocBuffer::record_slow_allocation(size_t obj_size) {

本体部(body)

  {- -------------------------------------------
  (1) ThreadLocalAllocBuffer::refill_waste_limit() の値を増加させる.
      (ついでに, _slow_allocations フィールドの値もインクリメントしている)

      (この処理を行うのは, 同じサイズの確保を何度も行うようなプログラムの場合, 
       閾値が同じだと一度引っかかるとずっと slow-path になり続ける恐れがあるため.
       See: CollectedHeap::allocate_from_tlab_slow())
      ---------------------------------------- -}

      // Raise size required to bypass TLAB next time. Why? Else there's
      // a risk that a thread that repeatedly allocates objects of one
      // size will get stuck on this slow path.

      set_refill_waste_limit(refill_waste_limit() + refill_waste_limit_increment());

      _slow_allocations++;

  {- -------------------------------------------
  (1) (トレース出力)
      ---------------------------------------- -}

      if (PrintTLAB && Verbose) {
        Thread* thrd = myThread();
        gclog_or_tty->print("TLAB: %s thread: "INTPTR_FORMAT" [id: %2d]"
                            " obj: "SIZE_FORMAT
                            " free: "SIZE_FORMAT
                            " waste: "SIZE_FORMAT"\n",
                            "slow", thrd, thrd->osthread()->thread_id(),
                            obj_size, free(), refill_waste_limit());
      }
    }

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