JDK-6225666 : ParGC: assert at sharedHeap.cpp, line 116
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2005-02-04
  • Updated: 2024-10-07
  • Resolved: 2013-03-04
Related Reports
Relates :  
Relates :  
Description
While running specjbb, I encountered this assert in
SharedHeap::fill_region_with_object

    assert(word_size == (size_t)oopDesc::header_size(), "Unaligned?");

fill_region_with_object is being called from
PSMarkSweep::absorb_live_data_from_eden

  // Fill the unused part of the old gen.
  MutableSpace* const old_space = old_gen->object_space();
  MemRegion old_gen_unused(old_space->top(), old_space->end());
  if (!old_gen_unused.is_empty()) {
    SharedHeap::fill_region_with_object(old_gen_unused);
  }

We're about to move the boundary between the old and young generations.
We bridge the gap between the old gen top and end (and therefore the
gap between the old gen top and the young gen bottom) with a garbage
object.

If there isn't enough space (2 HeapWords == minimum object size) between
the old gen's top and end, we assert.  If we were to weaken the assert,
we'd end up stomping the header word of the first object in the young gen.
In the product vm, we'll do the latter without any notice to the user
and corrupt the heap.







###@###.### 2005-2-04 17:17:28 GMT

Comments
Current code absorb_live_data_from_eden() fails if there is not enough space for a filler object. if (unused_words > 0) { if (unused_words < CollectedHeap::min_fill_size()) { return false; // If the old gen cannot be filled, must give up. } CollectedHeap::fill_with_objects(unused_start, unused_words); } This is adequate for this feature that is not yet supported.
04-03-2013

EVALUATION See Description and Suggested Fix. ###@###.### 2005-2-04 18:11:44 GMT
04-02-2005

WORK AROUND Set -XX:-UseAdaptiveGCBoundary (debug vm only). ###@###.### 2005-2-04 17:17:28 GMT
04-02-2005

SUGGESTED FIX Add two new methods to SharedHeap, vis. // Minimum garbage fill object size static size_t min_fill_size() { return (size_t)align_object_size(oopDesc::header_size()); } static size_t min_fill_size_in_bytes() { return min_fill_size() * HeapWordSize; } In mutableSpace.cpp, allocate and cas_allocate, cause allocation to fail if if ((new_top > obj) && ((new_top + SharedHeap::min_fill_size()) <= end())) { I.e., cause allocation to fail if there's not enough room for a fill object at the end of the space. Whether this is the only place this check should occur is unknown to me. It's possible that the compilers generate inline code that does a similar check. This assert in ParallelScavengeHeap::failed_mem_allocate assert(size > young_gen()->eden_space()->free_in_words(), "Allocation should fail"); must be modified to account for min_fill_size(), vis. assert(size > (young_gen()->eden_space()->free_in_words() - SharedHeap::min_fill_size()), "Allocation should fail"); ###@###.### 2005-2-04 17:17:28 GMT
04-02-2005