src/hotspot/share/memory/metaspace/chunkManager.cpp
changeset 54623 1126f0607c70
parent 53970 1ad7c590a6e7
child 57464 32e61f51ee09
child 58063 bdf136b8ae0e
equal deleted inserted replaced
54622:a8dcacf95bff 54623:1126f0607c70
     1 /*
     1 /*
     2  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2018, 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.
   225   return get_size_for_nonhumongous_chunktype(index, is_class());
   225   return get_size_for_nonhumongous_chunktype(index, is_class());
   226 }
   226 }
   227 
   227 
   228 #ifdef ASSERT
   228 #ifdef ASSERT
   229 void ChunkManager::verify(bool slow) const {
   229 void ChunkManager::verify(bool slow) const {
   230   MutexLockerEx cl(MetaspaceExpand_lock,
   230   MutexLocker cl(MetaspaceExpand_lock,
   231                      Mutex::_no_safepoint_check_flag);
   231                      Mutex::_no_safepoint_check_flag);
   232   locked_verify(slow);
   232   locked_verify(slow);
   233 }
   233 }
   234 
   234 
   235 void ChunkManager::locked_verify(bool slow) const {
   235 void ChunkManager::locked_verify(bool slow) const {
   628         num_chunks_returned, size_chunks_returned);
   628         num_chunks_returned, size_chunks_returned);
   629   }
   629   }
   630 }
   630 }
   631 
   631 
   632 void ChunkManager::collect_statistics(ChunkManagerStatistics* out) const {
   632 void ChunkManager::collect_statistics(ChunkManagerStatistics* out) const {
   633   MutexLockerEx cl(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
   633   MutexLocker cl(MetaspaceExpand_lock, Mutex::_no_safepoint_check_flag);
   634   for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) {
   634   for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) {
   635     out->chunk_stats(i).add(num_free_chunks(i), size_free_chunks_in_bytes(i) / sizeof(MetaWord));
   635     out->chunk_stats(i).add(num_free_chunks(i), size_free_chunks_in_bytes(i) / sizeof(MetaWord));
   636   }
   636   }
   637 }
   637 }
   638 
   638