EVALUATION
See main CR
|
|
|
EVALUATION
http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/87e40b34bc2b
|
|
|
EVALUATION
http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/87e40b34bc2b
|
|
|
EVALUATION
http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/87e40b34bc2b
|
|
|
SUGGESTED FIX
diff -r 0defeba52583 src/share/vm/services/gcNotifier.cpp
--- a/src/share/vm/services/gcNotifier.cpp Tue Jul 12 16:32:25 2011 -0700
+++ b/src/share/vm/services/gcNotifier.cpp Fri Aug 05 10:32:12 2011 -0700
@@ -100,9 +100,14 @@
// Fill the arrays of MemoryUsage objects with before and after GC
// per pool memory usage
- klassOop muKlass = Management::java_lang_management_MemoryUsage_klass(CHECK_NH); objArrayOop bu = oopFactory::new_objArray( muKlass,MemoryService::num_memory_pools(), CHECK_NH);
+ klassOop mu_klass = Management::java_lang_management_MemoryUsage_klass(CHECK_NH);
+ instanceKlassHandle mu_kh(THREAD, mu_klass);
+ objArrayOop bu = oopFactory::new_objArray(mu_kh(), MemoryService::num_memory_pools(), CHECK_NH);
objArrayHandle usage_before_gc_ah(THREAD, bu);
- objArrayOop au = oopFactory::new_objArray(muKlass,MemoryService::num_memory_pools(), CHECK_NH);
+ objArrayOop au = oopFactory::new_objArray(mu_kh(), MemoryService::num_memory_pools(), CHECK_NH);
objArrayHandle usage_after_gc_ah(THREAD, au);
for (int i = 0; i < MemoryService::num_memory_pools(); i++) {
|
|
|
EVALUATION
Potential naked oop across a call that could potentially GC in createGCInfo in gcNotifier.cpp:
static Handle createGcInfo(GCMemoryManager *gcManager, GCStatInfo *gcStatInfo,TRAPS) {
// Fill the arrays of MemoryUsage objects with before and after GC
// per pool memory usage
klassOop muKlass = Management::java_lang_management_MemoryUsage_klass(CHECK_NH);
objArrayOop bu = oopFactory::new_objArray( muKlass,MemoryService::num_memory_pools(), CHECK_NH);
objArrayHandle usage_before_gc_ah(THREAD, bu);
objArrayOop au = oopFactory::new_objArray(muKlass,MemoryService::num_memory_pools(), CHECK_NH);
objArrayHandle usage_after_gc_ah(THREAD, au);
Suppose the call to new_objArray results in a GC then the class to which muKlass points may have been moved.
Note: the ServiceThread is a Java thread. Even though it is handling a gc notification - we are not at a safepoint when executing the above code:
During a GG, the VM thread will push the gc notification event and signal the Service_Lock. The ServiceThread, which was blocked waiting on the Service_Lock, is still stopped (for the safepoint). _After_ the safepoint the ServiceThread restarts; obtains the Service_Lock, and starts procssing the notification and, when the first allocation above is executed, causes a GC.
|
|
|
|