src/hotspot/share/gc/shared/cardGeneration.cpp
changeset 49164 7e958a8ebcd3
parent 47216 71c04702a3d5
child 49734 f946776e9354
equal deleted inserted replaced
49163:580bb0b85f63 49164:7e958a8ebcd3
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    77   if (result) {
    77   if (result) {
    78     size_t new_word_size =
    78     size_t new_word_size =
    79        heap_word_size(_virtual_space.committed_size());
    79        heap_word_size(_virtual_space.committed_size());
    80     MemRegion mr(space()->bottom(), new_word_size);
    80     MemRegion mr(space()->bottom(), new_word_size);
    81     // Expand card table
    81     // Expand card table
    82     GenCollectedHeap::heap()->barrier_set()->resize_covered_region(mr);
    82     GenCollectedHeap::heap()->rem_set()->resize_covered_region(mr);
    83     // Expand shared block offset array
    83     // Expand shared block offset array
    84     _bts->resize(new_word_size);
    84     _bts->resize(new_word_size);
    85 
    85 
    86     // Fix for bug #4668531
    86     // Fix for bug #4668531
    87     if (ZapUnusedHeapArea) {
    87     if (ZapUnusedHeapArea) {
   164   size_t new_word_size = heap_word_size(space()->capacity());
   164   size_t new_word_size = heap_word_size(space()->capacity());
   165   // Shrink the shared block offset array
   165   // Shrink the shared block offset array
   166   _bts->resize(new_word_size);
   166   _bts->resize(new_word_size);
   167   MemRegion mr(space()->bottom(), new_word_size);
   167   MemRegion mr(space()->bottom(), new_word_size);
   168   // Shrink the card table
   168   // Shrink the card table
   169   GenCollectedHeap::heap()->barrier_set()->resize_covered_region(mr);
   169   GenCollectedHeap::heap()->rem_set()->resize_covered_region(mr);
   170 
   170 
   171   size_t new_mem_size = _virtual_space.committed_size();
   171   size_t new_mem_size = _virtual_space.committed_size();
   172   size_t old_mem_size = new_mem_size + size;
   172   size_t old_mem_size = new_mem_size + size;
   173   log_trace(gc, heap)("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K",
   173   log_trace(gc, heap)("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K",
   174                       name(), old_mem_size/K, new_mem_size/K);
   174                       name(), old_mem_size/K, new_mem_size/K);