提交 873e1642 编写于 作者: J johnc

7052429: G1: Avoid unnecessary scanning of humongous regions during concurrent marking

Summary: Skip unnecessary scanning of bitmap for unmarked humongous objects/regions.
Reviewed-by: jwilhelm, johnc
Contributed-by: NTao Mao <tao.mao@oracle.com>
上级 e448c531
......@@ -4066,11 +4066,23 @@ void CMTask::do_marking_step(double time_target_ms,
_worker_id, _finger, _region_limit, _curr_region);
}
// Let's iterate over the bitmap of the part of the
// region that is left.
if (mr.is_empty() || _nextMarkBitMap->iterate(&bitmap_closure, mr)) {
// We successfully completed iterating over the region. Now,
// let's give up the region.
HeapRegion* hr = _g1h->heap_region_containing(mr.start());
assert(!hr->isHumongous() || mr.start() == hr->bottom(),
"the start of HeapRegion and MemRegion should be consistent for humongous regions");
// The special case of the bitmap of a humongous region with its first
// bit NOT marked should be avoided from (wasteful) iterating.
// Note that the alternative case of the bitmap of a humongous region
// with its first bit marked is handled properly in the iterate() routine.
// Then, let's iterate over the bitmap of the part of the region that is
// left.
// If the iteration is successful, give up the region.
// Also note that the case of the bitmap of a humongous region with its
// first bit NOT marked is considered "successful", leveraging the fact
// that the entire bitmap consists of all 0's in such case.
if (mr.is_empty() ||
(hr != NULL && hr->isHumongous() && !_nextMarkBitMap->isMarked(mr.start())) ||
_nextMarkBitMap->iterate(&bitmap_closure, mr)) {
giveup_current_region();
regular_clock_call();
} else {
......
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -1816,7 +1816,7 @@ class CommandLineFlags {
\
product(uintx, InitiatingHeapOccupancyPercent, 45, \
"Percentage of the (entire) heap occupancy to start a " \
"concurrent GC cycle. It us used by GCs that trigger a " \
"concurrent GC cycle. It is used by GCs that trigger a " \
"concurrent GC cycle based on the occupancy of the entire heap, " \
"not just one of the generations (e.g., G1). A value of 0 " \
"denotes 'do constant GC cycles'.") \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册