src/hotspot/share/gc/parallel/psOldGen.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54678 93f09ca4a7f8
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2019, 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.
   223 }
   223 }
   224 
   224 
   225 HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
   225 HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
   226   expand(word_size*HeapWordSize);
   226   expand(word_size*HeapWordSize);
   227   if (GCExpandToAllocateDelayMillis > 0) {
   227   if (GCExpandToAllocateDelayMillis > 0) {
   228     os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
   228     os::naked_sleep(GCExpandToAllocateDelayMillis);
   229   }
   229   }
   230   return allocate_noexpand(word_size);
   230   return allocate_noexpand(word_size);
   231 }
   231 }
   232 
   232 
   233 HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size) {
   233 HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size) {
   234   expand(word_size*HeapWordSize);
   234   expand(word_size*HeapWordSize);
   235   if (GCExpandToAllocateDelayMillis > 0) {
   235   if (GCExpandToAllocateDelayMillis > 0) {
   236     os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
   236     os::naked_sleep(GCExpandToAllocateDelayMillis);
   237   }
   237   }
   238   return cas_allocate_noexpand(word_size);
   238   return cas_allocate_noexpand(word_size);
   239 }
   239 }
   240 
   240 
   241 void PSOldGen::expand(size_t bytes) {
   241 void PSOldGen::expand(size_t bytes) {
   441                 p2i(virtual_space()->high_boundary()));
   441                 p2i(virtual_space()->high_boundary()));
   442 
   442 
   443   st->print("  object"); object_space()->print_on(st);
   443   st->print("  object"); object_space()->print_on(st);
   444 }
   444 }
   445 
   445 
   446 void PSOldGen::print_used_change(size_t prev_used) const {
       
   447   log_info(gc, heap)("%s: "  SIZE_FORMAT "K->" SIZE_FORMAT "K("  SIZE_FORMAT "K)",
       
   448       name(), prev_used / K, used_in_bytes() / K, capacity_in_bytes() / K);
       
   449 }
       
   450 
       
   451 void PSOldGen::update_counters() {
   446 void PSOldGen::update_counters() {
   452   if (UsePerfData) {
   447   if (UsePerfData) {
   453     _space_counters->update_all();
   448     _space_counters->update_all();
   454     _gen_counters->update_all();
   449     _gen_counters->update_all();
   455   }
   450   }