< prev index next >
src/share/vm/memory/metaspace.cpp
Print this page
*** 789,799 ****
Monitor::_safepoint_check_never);
void VirtualSpaceNode::inc_container_count() {
assert_lock_strong(SpaceManager::expand_lock());
_container_count++;
- DEBUG_ONLY(verify_container_count();)
}
void VirtualSpaceNode::dec_container_count() {
assert_lock_strong(SpaceManager::expand_lock());
_container_count--;
--- 789,798 ----
*** 1071,1080 ****
--- 1070,1080 ----
VirtualSpaceNode* purged_vsl = NULL;
VirtualSpaceNode* prev_vsl = virtual_space_list();
VirtualSpaceNode* next_vsl = prev_vsl;
while (next_vsl != NULL) {
VirtualSpaceNode* vsl = next_vsl;
+ DEBUG_ONLY(vsl->verify_container_count();)
next_vsl = vsl->next();
// Don't free the current virtual space since it will likely
// be needed soon.
if (vsl->container_count() == 0 && vsl != current_virtual_space()) {
// Unlink it from the list
*** 1135,1157 ****
vsn->retire(cm);
}
void VirtualSpaceNode::retire(ChunkManager* chunk_manager) {
for (int i = (int)MediumIndex; i >= (int)ZeroIndex; --i) {
ChunkIndex index = (ChunkIndex)i;
size_t chunk_size = chunk_manager->free_chunks(index)->size();
while (free_words_in_vs() >= chunk_size) {
- DEBUG_ONLY(verify_container_count();)
Metachunk* chunk = get_chunk_vs(chunk_size);
assert(chunk != NULL, "allocation should have been successful");
chunk_manager->return_chunks(index, chunk);
chunk_manager->inc_free_chunks_total(chunk_size);
- DEBUG_ONLY(verify_container_count();)
}
}
assert(free_words_in_vs() == 0, "should be empty now");
}
VirtualSpaceList::VirtualSpaceList(size_t word_size) :
--- 1135,1157 ----
vsn->retire(cm);
}
void VirtualSpaceNode::retire(ChunkManager* chunk_manager) {
+ DEBUG_ONLY(verify_container_count();)
for (int i = (int)MediumIndex; i >= (int)ZeroIndex; --i) {
ChunkIndex index = (ChunkIndex)i;
size_t chunk_size = chunk_manager->free_chunks(index)->size();
while (free_words_in_vs() >= chunk_size) {
Metachunk* chunk = get_chunk_vs(chunk_size);
assert(chunk != NULL, "allocation should have been successful");
chunk_manager->return_chunks(index, chunk);
chunk_manager->inc_free_chunks_total(chunk_size);
}
+ DEBUG_ONLY(verify_container_count();)
}
assert(free_words_in_vs() == 0, "should be empty now");
}
VirtualSpaceList::VirtualSpaceList(size_t word_size) :
< prev index next >