How to exercise the GC notification code in gcNotifier.cpp

Frederic Parain frederic.parain at
Tue Aug 9 05:52:57 PDT 2011

Hi John,

I've checked the code using the muKlass oop and I confirm
that there's an issue with the muKlass oop. It is used in
two successive calls to oopFactory::new_objArray() and if
a GC occurs during the first call, the oop could be invalid
for the second call. The fix is straightforward (creating
and using an instanceKlassHandle instead of the oop), I'll
try to push it ASAP.



PS: I was not able to reproduce the failure either.

On 08/ 5/11 12:12 AM, John Cuthbertson wrote:
> Hi Everyone,
> After investigating an issue that was reported while running a fairly
> substantial application, I believe I have found naked oop in the GC
> notification code which I think is the cause of the problem The oop in
> question is the muKlass oop in createGCInfo in gcNotifier.cpp. This code
> is executed by the ServiceThread as part of the sendNotification routine
> which pulls items from some request queue. The items on this queue seem
> to be added as a result of GC end events being pushed by the
> MemoryManagerService if the routine
> GCMemoryManager::is_notification_enabled() returns true. This field is
> set to true by the routine jmm_SetGCNotificationEnabled in
> management.cpp. Can anyone tell me how I can explicitly exercise this
> code? I have tried some things in jconsole and jvisualvm but have so far
> been unsuccessful.
> Thanks,
> JohnC

Frederic Parain - Oracle
Grenoble Engineering Center - France
Phone: +33 4 76 18 81 17
Email: Frederic.Parain at

More information about the hotspot-runtime-dev mailing list