SUGGESTED FIX
The updated fix (assertion check added).
arches% hg diff src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -3075,7 +3075,18 @@ void CompactibleFreeListSpace:: par_get_
if (rem > 0 && rem < MinChunkSize) {
n--; rem += word_sz;
}
- assert((ssize_t)n >= 1, "Control point invariant");
+ // Note that at this point we may have n == 0.
+ assert((ssize_t)n >= 0, "Control point invariant");
+
+ // If n is 0, the chunk fc that was found is not large
+ // enough to leave a viable remainder. We are unable to
+ // allocate even one block. Return fc to the
+ // dictionary and return, leaving "fl" empty.
+ if (n == 0) {
+ returnChunkToDictionary(fc);
+ return;
+ }
+
// First return the remainder, if any.
// Note that we hold the lock until we decide if we're going to give
// back the remainder to the dictionary, since a concurrent allocation
|
SUGGESTED FIX
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
@@ -2731,6 +2731,14 @@ par_get_chunk_of_blocks(size_t word_sz,
if (rem > 0 && rem < MinChunkSize) {
n--; rem += word_sz;
}
+ // If n is 0, there chunk fc that was found is not large
+ // enough to leave a viable remainder. Return fc to the
+ // dictionary and return.
+ if (n == 0) {
+ returnChunkToDictionary(fc);
+ return;
+ }
+
// First return the remainder, if any.
// Note that we hold the lock until we decide if we're going to give
// back the remainder to the dictionary, since a contending allocator
|