How to exercise the GC notification code in gcNotifier.cpp

Krystal Mok rednaxelafx at
Thu Aug 4 18:41:44 PDT 2011

Hi John,

If you prefer JConsole for testing interactively, you can explicitly
subscribe/unsubscribe to a GarbageCollector notification, like this:
1. Select the MBeans tab, then select a java.lang.GarbageCollector
2. Click "Notifications" under the GarbageCollector
3. Click the "Subscribe" button on the bottom right
and then will
be invoked, which in turn will set SetGCNotificationEnabled to
true. Unsubscribing is similar.

The notification code was added in this rev (or somewhere close...):

Kris Mok

On Fri, Aug 5, 2011 at 6:12 AM, John Cuthbertson <
john.cuthbertson at> 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
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the hotspot-runtime-dev mailing list