--- old/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp 2015-04-08 16:59:19.384175483 -0400 +++ new/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp 2015-04-08 16:59:19.296847379 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, 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 @@ -65,6 +65,7 @@ assert_locked_or_safepoint(Heap_lock); HeapWord* res = object_space()->allocate(word_size); if (res != NULL) { + assert(_start_array.covered_region().contains(MemRegion(res, word_size)), "Allocated beyond end of covered region"); _start_array.allocate_block(res); } return res; @@ -77,6 +78,7 @@ assert(SafepointSynchronize::is_at_safepoint(), "Must only be called at safepoint"); HeapWord* res = object_space()->cas_allocate(word_size); if (res != NULL) { + assert(_start_array.covered_region().contains(MemRegion(res, word_size)), "Allocated beyond end of covered region"); _start_array.allocate_block(res); } return res; --- old/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp 2015-04-08 16:59:19.764692685 -0400 +++ new/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp 2015-04-08 16:59:19.674399216 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -152,11 +152,22 @@ bool PSOldPromotionLAB::lab_is_valid(MemRegion lab) { ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - assert(_start_array->covered_region().contains(lab), "Sanity"); + MemRegion covered_region = _start_array->covered_region(); PSOldGen* old_gen = heap->old_gen(); MemRegion used = old_gen->object_space()->used_region(); + assert(covered_region.contains(lab), + err_msg("Sanity - covered_region [ "PTR_FORMAT", "PTR_FORMAT" ], " + "lab [ "PTR_FORMAT", "PTR_FORMAT" ], " + "object space [ "PTR_FORMAT", "PTR_FORMAT" ]", + p2i(covered_region.start()), + p2i(covered_region.end()), + p2i(lab.start()), + p2i(lab.end()), + p2i(used.start()), + p2i(used.end()))); + if (used.contains(lab)) { return true; } --- old/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp 2015-04-08 16:59:20.137815575 -0400 +++ new/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp 2015-04-08 16:59:20.047399878 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -124,6 +124,7 @@ set_top(new_top); assert(is_object_aligned((intptr_t)obj) && is_object_aligned((intptr_t)new_top), "checking alignment"); + assert(_start_array->covered_region().contains(MemRegion(obj, size)), "Allocated beyond end of covered region"); _start_array->allocate_block(obj); return obj; }