It's difficult to trigger the assert but it happens for me every now and then when using -ZapUnusedHeapArea. The fix seems to be pretty obvious:
diff --git a/src/share/vm/memory/threadLocalAllocBuffer.cpp b/src/share/vm/memory/threadLocalAllocBuffer.cpp
--- a/src/share/vm/memory/threadLocalAllocBuffer.cpp
+++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp
@@ -42,7 +42,7 @@
_slow_refill_waste += (unsigned)remaining();
// In debug mode we expect the storage above top to be uninitialized
// or filled with a padding object.
- assert(top() == NULL || *(intptr_t*)top() != 0, "overzeroing detected");
+ assert(!ZapUnusedHeapArea || top() == NULL || *(intptr_t*)top() != 0, "overzeroing detected");
make_parsable(true); // also retire the TLAB
}
diff --git a/src/share/vm/memory/threadLocalAllocBuffer.cpp b/src/share/vm/memory/threadLocalAllocBuffer.cpp
--- a/src/share/vm/memory/threadLocalAllocBuffer.cpp
+++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp
@@ -42,7 +42,7 @@
_slow_refill_waste += (unsigned)remaining();
// In debug mode we expect the storage above top to be uninitialized
// or filled with a padding object.
- assert(top() == NULL || *(intptr_t*)top() != 0, "overzeroing detected");
+ assert(!ZapUnusedHeapArea || top() == NULL || *(intptr_t*)top() != 0, "overzeroing detected");
make_parsable(true); // also retire the TLAB
}