--- a/src/hotspot/share/gc/serial/defNewGeneration.cpp Wed Apr 11 11:41:30 2018 +0200
+++ b/src/hotspot/share/gc/serial/defNewGeneration.cpp Wed Apr 11 13:51:33 2018 +0200
@@ -1006,9 +1006,11 @@
// have to use it here, as well.
HeapWord* result = eden()->par_allocate(word_size);
if (result != NULL) {
+#if INCLUDE_ALL_GCS
if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
_old_gen->sample_eden_chunk();
}
+#endif
} else {
// If the eden is full and the last collection bailed out, we are running
// out of heap space, and we try to allocate the from-space, too.
@@ -1022,9 +1024,11 @@
HeapWord* DefNewGeneration::par_allocate(size_t word_size,
bool is_tlab) {
HeapWord* res = eden()->par_allocate(word_size);
+#if INCLUDE_ALL_GCS
if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
_old_gen->sample_eden_chunk();
}
+#endif
return res;
}