diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 28c733c150f11a8b2a3ed90fc4da29b6642943cc..810e3c27af1dae5053f145399ed08c7776468d3e 100644 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -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 { diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp index 7db81d805bd39be7f42fb40700f63cd49f8e1d96..f6c1089868c2276d3ac4061d802cb5a90ff27fc3 100644 --- a/src/share/vm/runtime/globals.hpp +++ b/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * 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'.") \