comparison src/share/vm/services/virtualMemoryTracker.cpp @ 27292:eb84884dbeaa

8146523: VirtualMemoryTracker::remove_released_region double count unmapped CDS shared memory Summary: Skip tracking release for unmapped CDS shared space. Reviewed-by: dholmes, coleenp, iklam, gtriantafill
author jiangli
date Tue, 12 Jan 2016 19:15:42 -0500
parents f10efc097bae
children 5b24bff4ad46 51ff9e7c2b51
comparison
equal deleted inserted replaced
14:ce36f17b8d7a 16:c372dd5b07c7
1 /* 1 /*
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2016, 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.
414 // uncommit regions within the released region 414 // uncommit regions within the released region
415 if (!reserved_rgn->remove_uncommitted_region(addr, size)) { 415 if (!reserved_rgn->remove_uncommitted_region(addr, size)) {
416 return false; 416 return false;
417 } 417 }
418 418
419 if (reserved_rgn->flag() == mtClassShared &&
420 reserved_rgn->contain_region(addr, size) &&
421 !reserved_rgn->same_region(addr, size)) {
422 // This is an unmapped CDS region, which is part of the reserved shared
423 // memory region.
424 // See special handling in VirtualMemoryTracker::add_reserved_region also.
425 return true;
426 }
419 427
420 VirtualMemorySummary::record_released_memory(size, reserved_rgn->flag()); 428 VirtualMemorySummary::record_released_memory(size, reserved_rgn->flag());
421 429
422 if (reserved_rgn->same_region(addr, size)) { 430 if (reserved_rgn->same_region(addr, size)) {
423 return _reserved_regions->remove(rgn); 431 return _reserved_regions->remove(rgn);