< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp

Print this page
*** 1,7 ***
--- 1,8 ---
  /*
   * Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 26,10 ***
--- 27,11 ---
  #include "gc/shared/gcArguments.hpp"
  #include "gc/shared/tlab_globals.hpp"
  #include "gc/shared/workerPolicy.hpp"
  #include "gc/shenandoah/shenandoahArguments.hpp"
  #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
+ #include "gc/shenandoah/shenandoahGenerationalHeap.hpp"
  #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  #include "gc/shenandoah/shenandoahHeapRegion.hpp"
  #include "runtime/globals_extension.hpp"
  #include "runtime/java.hpp"
  #include "utilities/defaultStream.hpp"

*** 47,10 ***
--- 49,11 ---
    FLAG_SET_DEFAULT(ShenandoahGCHeuristics,           "passive");
  
    FLAG_SET_DEFAULT(ShenandoahSATBBarrier,            false);
    FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier,         false);
    FLAG_SET_DEFAULT(ShenandoahCASBarrier,             false);
+   FLAG_SET_DEFAULT(ShenandoahCardBarrier,            false);
    FLAG_SET_DEFAULT(ShenandoahCloneBarrier,           false);
  
    FLAG_SET_DEFAULT(ShenandoahVerifyOptoBarriers,     false);
  #endif
    if (UseLargePages) {

*** 66,10 ***
--- 69,17 ---
    // storage allocation code NUMA-aware.
    if (FLAG_IS_DEFAULT(UseNUMA)) {
      FLAG_SET_DEFAULT(UseNUMA, true);
    }
  
+   // We use this as the time period for tracking minimum mutator utilization (MMU).
+   // In generational mode, the MMU is used as a signal to adjust the size of the
+   // young generation.
+   if (FLAG_IS_DEFAULT(GCPauseIntervalMillis)) {
+     FLAG_SET_DEFAULT(GCPauseIntervalMillis, 5000);
+   }
+ 
    // Set up default number of concurrent threads. We want to have cycles complete fast
    // enough, but we also do not want to steal too much CPU from the concurrently running
    // application. Using 1/4 of available threads for concurrent GC seems a good
    // compromise here.
    bool ergo_conc = FLAG_IS_DEFAULT(ConcGCThreads);

*** 184,10 ***
--- 194,12 ---
    }
    return align;
  }
  
  void ShenandoahArguments::initialize_alignments() {
+   CardTable::initialize_card_size();
+ 
    // Need to setup sizes early to get correct alignments.
    MaxHeapSize = ShenandoahHeapRegion::setup_sizes(MaxHeapSize);
  
    // This is expected by our algorithm for ShenandoahHeap::heap_region_containing().
    size_t align = ShenandoahHeapRegion::region_size_bytes();

*** 197,7 ***
    SpaceAlignment = align;
    HeapAlignment = align;
  }
  
  CollectedHeap* ShenandoahArguments::create_heap() {
!   return new ShenandoahHeap(new ShenandoahCollectorPolicy());
  }
--- 209,12 ---
    SpaceAlignment = align;
    HeapAlignment = align;
  }
  
  CollectedHeap* ShenandoahArguments::create_heap() {
!   if (strcmp(ShenandoahGCMode, "generational") != 0) {
+     // Not generational
+     return new ShenandoahHeap(new ShenandoahCollectorPolicy());
+   } else {
+     return new ShenandoahGenerationalHeap(new ShenandoahCollectorPolicy());
+   }
  }
< prev index next >