changeset 38:0f15d6873c2d

Bug 2366: Change the calculation of g1StartAddr to create the bitmap for G1GC reviewed-by: yasuenag
author KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
date Mon, 18 May 2015 00:39:19 +0900
parents 80933f82c4c0
children 48632080be2a
files agent/ChangeLog agent/src/oopUtil.cpp
diffstat 2 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/agent/ChangeLog	Mon May 18 00:36:35 2015 +0900
+++ b/agent/ChangeLog	Mon May 18 00:39:19 2015 +0900
@@ -1,3 +1,7 @@
+2015-05-18 KUBOTA Yuji  <kubota.yuji@lab.ntt.co.jp>
+
+	* Bug 2366: Change the calculation of g1StartAddr to create the bitmap for G1GC
+
 2015-05-18 KUBOTA Yuji  <kubota.yuji@lab.ntt.co.jp>
 
 	* Bug 2365: Adapt to G1GC hook points of JDK-8049421
--- a/agent/src/oopUtil.cpp	Mon May 18 00:36:35 2015 +0900
+++ b/agent/src/oopUtil.cpp	Mon May 18 00:39:19 2015 +0900
@@ -2677,11 +2677,11 @@
 bool setupForG1GC(size_t maxMemSize) {
     SELECT_HOOK_FUNCS(g1);
     
-    off_t offsetG1Committed    = -1;
+    off_t offsetReserved       = -1;
     off_t offsetMemRegionStart = -1;
     TOffsetNameMap ofsMap[] = {
-        {"G1CollectedHeap",        "_g1_committed",
-            &offsetG1Committed,    NULL},
+        {"CollectedHeap",          "_reserved",
+            &offsetReserved   ,    NULL},
         {"MemRegion",              "_start",
             &offsetMemRegionStart, NULL},
         /* End flag. */
@@ -2691,7 +2691,7 @@
     vmScanner->GetDataFromVMStructs(ofsMap);
     
     /* If failure getting offset. */
-    if (unlikely(offsetG1Committed == -1 || offsetMemRegionStart == -1
+    if (unlikely(offsetReserved == -1 || offsetMemRegionStart == -1
         || collectedHeap == NULL)) {
         
         PRINT_WARN_MSG("Failure getting information form JVM."
@@ -2700,9 +2700,9 @@
     }
     
     /* Calculate about G1GC memory information. */
-    void *g1Committed = *(void**)incAddress(collectedHeap, offsetG1Committed);
-    void *g1StartAddr = incAddress(g1Committed, offsetMemRegionStart);
-    if (unlikely(g1Committed == NULL || g1StartAddr == NULL)) {
+    void *reservedRegion = *(void**)incAddress(collectedHeap, offsetReserved);
+    void *g1StartAddr = incAddress(reservedRegion, offsetMemRegionStart);
+    if (unlikely(reservedRegion == NULL || g1StartAddr == NULL)) {
         
         PRINT_WARN_MSG("Failure getting information form JVM."
             " info:G1 from:calculate");