< prev index next >

src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp

Print this page
@@ -1,7 +1,8 @@
  /*
   * Copyright (c) 2018, 2019, 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.

@@ -30,23 +31,22 @@
  #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
  #include "logging/log.hpp"
  #include "logging/logTag.hpp"
  
- ShenandoahStaticHeuristics::ShenandoahStaticHeuristics() : ShenandoahHeuristics() {
+ ShenandoahStaticHeuristics::ShenandoahStaticHeuristics(ShenandoahSpaceInfo* space_info) :
+   ShenandoahHeuristics(space_info) {
    SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent);
    SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent);
  }
  
  ShenandoahStaticHeuristics::~ShenandoahStaticHeuristics() {}
  
  bool ShenandoahStaticHeuristics::should_start_gc() {
-   ShenandoahHeap* heap = ShenandoahHeap::heap();
- 
-   size_t max_capacity = heap->max_capacity();
-   size_t capacity = heap->soft_max_capacity();
-   size_t available = heap->free_set()->available();
+   size_t max_capacity = _space_info->max_capacity();
+   size_t capacity = _space_info->soft_max_capacity();
+   size_t available = _space_info->available();
  
    // Make sure the code below treats available without the soft tail.
    size_t soft_tail = max_capacity - capacity;
    available = (available > soft_tail) ? (available - soft_tail) : 0;
  
< prev index next >