Top


定義場所(file name)

hotspot/src/share/vm/services/memoryService.cpp

名前(function name)

void MemoryService::add_g1PermGen_memory_pool(G1CollectedHeap* g1h,
                                              MemoryManager* mgr) {

本体部(body)

  {- -------------------------------------------
  (1) MemoryService::add_space() で ContiguousSpacePool のインスタンスを生成し, 
      引数で渡された MemoryManager に登録する.

      (なお, UseSharedSpaces オプションが指定されている場合には, 
       共有されている部分用に (read-only と read-write に分けて)
       さらに 2つの ContiguousSpacePool オブジェクトを MemoryService::add_space() で生成し, 
       引数で渡された MemoryManager に登録しておく)
      ---------------------------------------- -}

      assert(mgr != NULL, "should have one manager");

      CompactingPermGenGen* perm_gen = (CompactingPermGenGen*) g1h->perm_gen();
      PermanentGenerationSpec* spec = perm_gen->spec();
      size_t max_size = spec->max_size() - spec->read_only_size()
                                         - spec->read_write_size();
      MemoryPool* pool = add_space(perm_gen->unshared_space(),
                                   "G1 Perm Gen",
                                   false, /* is_heap */
                                   max_size,
                                   true   /* support_usage_threshold */);
      mgr->add_pool(pool);

      // in case we support CDS in G1
      if (UseSharedSpaces) {
        pool = add_space(perm_gen->ro_space(),
                         "G1 Perm Gen [shared-ro]",
                         false, /* is_heap */
                         spec->read_only_size(),
                         true   /* support_usage_threshold */);
        mgr->add_pool(pool);

        pool = add_space(perm_gen->rw_space(),
                         "G1 Perm Gen [shared-rw]",
                         false, /* is_heap */
                         spec->read_write_size(),
                         true   /* support_usage_threshold */);
        mgr->add_pool(pool);
      }
    }

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