# HG changeset patch # User KUBOTA Yuji # Date 1431877673 -32400 # Node ID a4398da82c5b3b82a42b7fa4031ab804d7f1b4d6 # Parent 6fee1594fa18de39ea7c31dbafc8dbbb87efaa77 Bug 2366: Change the calculation of g1StartAddr to create the bitmap for G1GC reviewed-by: yasuenag diff -r 6fee1594fa18 -r a4398da82c5b agent/ChangeLog --- a/agent/ChangeLog Mon May 18 00:45:30 2015 +0900 +++ b/agent/ChangeLog Mon May 18 00:47:53 2015 +0900 @@ -1,3 +1,7 @@ +2015-05-18 KUBOTA Yuji + + * Bug 2366: Change the calculation of g1StartAddr to create the bitmap for G1GC + 2015-05-18 KUBOTA Yuji * Bug 2365: Adapt to G1GC hook points of JDK-8049421 diff -r 6fee1594fa18 -r a4398da82c5b agent/src/oopUtil.cpp --- a/agent/src/oopUtil.cpp Mon May 18 00:45:30 2015 +0900 +++ b/agent/src/oopUtil.cpp Mon May 18 00:47:53 2015 +0900 @@ -2141,13 +2141,13 @@ */ bool setupForG1GC(size_t maxMemSize) { - off_t offsetG1Committed = -1; + off_t offsetReserved = -1; off_t offsetMemRegionStart = -1; TOffsetNameMap ofsMap[] = { - {"G1CollectedHeap", "_g1_committed", - &offsetG1Committed, NULL}, - {"MemRegion", "_start", - &offsetMemRegionStart, NULL}, + {"CollectedHeap", "_reserved", + &offsetReserved, NULL}, + {"MemRegion", "_start", + &offsetMemRegionStart, NULL}, /* End flag. */ {NULL, NULL, NULL, NULL} }; @@ -2155,7 +2155,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." @@ -2164,9 +2164,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");