Skip to content

Commit af033c6

Browse files
author
Paul Hohensee
committed
8313081: MonitoringSupport_lock should be unconditionally initialized after 8304074
Reviewed-by: simonis Backport-of: a9d21c61fb12a11e18c6bb8aa903e5a8e42473f1
1 parent 66fa62a commit af033c6

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

hotspot/src/share/vm/runtime/mutexLocker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ void mutex_init() {
209209

210210
def(StringDedupQueue_lock , Monitor, leaf, true );
211211
def(StringDedupTable_lock , Mutex , leaf, true );
212-
213-
def(MonitoringSupport_lock , Mutex , leaf, true ); // used for serviceability monitoring support
214212
}
213+
def(MonitoringSupport_lock , Mutex , leaf, true ); // used for serviceability monitoring support
214+
215215
def(ParGCRareEvent_lock , Mutex , leaf , true );
216216
def(DerivedPointerTableGC_lock , Mutex, leaf, true );
217217
def(CodeCache_lock , Mutex , special, true );

hotspot/src/share/vm/services/management.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,7 @@ JVM_ENTRY(jlong, jmm_GetTotalThreadAllocatedMemory(JNIEnv *env))
22482248
}
22492249

22502250
{
2251+
assert(MonitoringSupport_lock != NULL, "Must be");
22512252
MutexLockerEx ml(MonitoringSupport_lock, Mutex::_no_safepoint_check_flag);
22522253
if (result < high_water_result) {
22532254
// Result wrapped to a negative value, in which case it's

jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@
2222
*/
2323

2424
/*
25-
* @test
26-
* @bug 6173675 8231209 8304074
25+
* @test id=G1
26+
* @bug 6173675 8231209 8304074 8313081
2727
* @summary Basic test of ThreadMXBean.getThreadAllocatedBytes
28-
* @author Paul Hohensee
28+
* @requires vm.gc == "G1"
29+
* @run main/othervm -XX:+UseG1GC ThreadAllocatedMemory
30+
*/
31+
32+
/*
33+
* @test id=Serial
34+
* @bug 6173675 8231209 8304074 8313081
35+
* @summary Basic test of ThreadMXBean.getThreadAllocatedBytes
36+
* @requires vm.gc == "Serial"
37+
* @run main/othervm -XX:+UseSerialGC ThreadAllocatedMemory
2938
*/
3039

3140
import java.lang.management.*;

0 commit comments

Comments
 (0)