diff -r 1a88d3c58e1d -r c9a07413e82b src/share/vm/gc_implementation/g1/heapRegion.cpp --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu May 20 01:34:22 2010 -0700 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu May 20 08:32:11 2010 -0700 @@ -554,11 +554,19 @@ #endif void HeapRegion::set_zero_fill_state_work(ZeroFillState zfs) { - assert(top() == bottom() || zfs == Allocated, - "Region must be empty, or we must be setting it to allocated."); assert(ZF_mon->owned_by_self() || Universe::heap()->is_gc_active(), "Must hold the lock or be a full GC to modify."); +#ifdef ASSERT + if (top() != bottom() && zfs != Allocated) { + ResourceMark rm; + stringStream region_str; + print_on(®ion_str); + assert(top() == bottom() || zfs == Allocated, + err_msg("Region must be empty, or we must be setting it to allocated. " + "_zfs=%d, zfs=%d, region: %s", _zfs, zfs, region_str.as_string())); + } +#endif _zfs = zfs; }