1 /*
2 * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
9524 size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) {
9525 size_t res = _sp->block_size_no_stall(addr, _collector);
9526 if (_sp->block_is_obj(addr)) {
9527 if (_live_bit_map->isMarked(addr)) {
9528 // It can't have been dead in a previous cycle
9529 guarantee(!_dead_bit_map->isMarked(addr), "No resurrection!");
9530 } else {
9531 _dead_bit_map->mark(addr); // mark the dead object
9532 }
9533 }
9534 // Could be 0, if the block size could not be computed without stalling.
9535 return res;
9536 }
9537
9538 TraceCMSMemoryManagerStats::TraceCMSMemoryManagerStats(CMSCollector::CollectorState phase, GCCause::Cause cause): TraceMemoryManagerStats() {
9539
9540 switch (phase) {
9541 case CMSCollector::InitialMarking:
9542 initialize(true /* fullGC */ ,
9543 cause /* cause of the GC */,
9544 true /* recordGCBeginTime */,
9545 true /* recordPreGCUsage */,
9546 false /* recordPeakUsage */,
9547 false /* recordPostGCusage */,
9548 true /* recordAccumulatedGCTime */,
9549 false /* recordGCEndTime */,
9550 false /* countCollection */ );
9551 break;
9552
9553 case CMSCollector::FinalMarking:
9554 initialize(true /* fullGC */ ,
9555 cause /* cause of the GC */,
9556 false /* recordGCBeginTime */,
9557 false /* recordPreGCUsage */,
9558 false /* recordPeakUsage */,
9559 false /* recordPostGCusage */,
9560 true /* recordAccumulatedGCTime */,
9561 false /* recordGCEndTime */,
9562 false /* countCollection */ );
9563 break;
9564
9565 case CMSCollector::Sweeping:
9566 initialize(true /* fullGC */ ,
9567 cause /* cause of the GC */,
9568 false /* recordGCBeginTime */,
9569 false /* recordPreGCUsage */,
9570 true /* recordPeakUsage */,
9571 true /* recordPostGCusage */,
9572 false /* recordAccumulatedGCTime */,
9573 true /* recordGCEndTime */,
9574 true /* countCollection */ );
9575 break;
9576
9577 default:
9578 ShouldNotReachHere();
9579 }
9580 }
|
1 /*
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.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
9524 size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) {
9525 size_t res = _sp->block_size_no_stall(addr, _collector);
9526 if (_sp->block_is_obj(addr)) {
9527 if (_live_bit_map->isMarked(addr)) {
9528 // It can't have been dead in a previous cycle
9529 guarantee(!_dead_bit_map->isMarked(addr), "No resurrection!");
9530 } else {
9531 _dead_bit_map->mark(addr); // mark the dead object
9532 }
9533 }
9534 // Could be 0, if the block size could not be computed without stalling.
9535 return res;
9536 }
9537
9538 TraceCMSMemoryManagerStats::TraceCMSMemoryManagerStats(CMSCollector::CollectorState phase, GCCause::Cause cause): TraceMemoryManagerStats() {
9539
9540 switch (phase) {
9541 case CMSCollector::InitialMarking:
9542 initialize(true /* fullGC */ ,
9543 cause /* cause of the GC */,
9544 true /* allMemoryPoolsAffected */,
9545 true /* recordGCBeginTime */,
9546 true /* recordPreGCUsage */,
9547 false /* recordPeakUsage */,
9548 false /* recordPostGCusage */,
9549 true /* recordAccumulatedGCTime */,
9550 false /* recordGCEndTime */,
9551 false /* countCollection */ );
9552 break;
9553
9554 case CMSCollector::FinalMarking:
9555 initialize(true /* fullGC */ ,
9556 cause /* cause of the GC */,
9557 true /* allMemoryPoolsAffected */,
9558 false /* recordGCBeginTime */,
9559 false /* recordPreGCUsage */,
9560 false /* recordPeakUsage */,
9561 false /* recordPostGCusage */,
9562 true /* recordAccumulatedGCTime */,
9563 false /* recordGCEndTime */,
9564 false /* countCollection */ );
9565 break;
9566
9567 case CMSCollector::Sweeping:
9568 initialize(true /* fullGC */ ,
9569 cause /* cause of the GC */,
9570 true /* allMemoryPoolsAffected */,
9571 false /* recordGCBeginTime */,
9572 false /* recordPreGCUsage */,
9573 true /* recordPeakUsage */,
9574 true /* recordPostGCusage */,
9575 false /* recordAccumulatedGCTime */,
9576 true /* recordGCEndTime */,
9577 true /* countCollection */ );
9578 break;
9579
9580 default:
9581 ShouldNotReachHere();
9582 }
9583 }
|