changeset 52330:3b6680f7542f

8212766: TestPromotionEventWithG1.java failed due to "RuntimeException: PLAB size is smaller than object size." Summary: Also send PLAB size in bytes, not in heap words. Reviewed-by: shade, sjohanss
author tschatzl
date Mon, 29 Oct 2018 08:55:03 +0100
parents 3ef47d047efc
children a8e43293b4c4
files src/hotspot/share/gc/g1/g1ParScanThreadState.cpp test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Mon Oct 29 08:52:04 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Mon Oct 29 08:55:03 2018 +0100
@@ -203,7 +203,7 @@
   if (alloc_buf->contains(obj_ptr)) {
     _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz * HeapWordSize, age,
                                                              dest_state.value() == InCSetState::Old,
-                                                             alloc_buf->word_sz());
+                                                             alloc_buf->word_sz() * HeapWordSize);
   } else {
     _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz * HeapWordSize, age,
                                                               dest_state.value() == InCSetState::Old);
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java	Mon Oct 29 08:52:04 2018 +0100
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java	Mon Oct 29 08:55:03 2018 +0100
@@ -26,6 +26,7 @@
 
 /**
  * @test
+ * @bug 8212766
  * @key jfr
  * @summary Test that events are created when an object is aged or promoted during a GC and the copying of the object requires a new PLAB or direct heap allocation
  * @requires vm.hasJFR
@@ -33,8 +34,8 @@
  * @requires (vm.gc == "G1" | vm.gc == null)
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
- * @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:+UseG1GC -XX:-UseStringDeduplication -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5
- * jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
+ * @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:+UseG1GC -XX:-UseStringDeduplication -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5 jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
+ * @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:+UseG1GC -XX:-UseStringDeduplication -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5 -XX:MinTLABSize=576 -XX:TLABSize=576 jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
  */
 public class TestPromotionEventWithG1 {