Java GARBAGE_COLLECTION_NOTIFICATION Received for NOT A REAL GC with every information being ZERO

208 views
Skip to first unread message

Tech Sigmainfy

unread,
Nov 10, 2015, 3:14:10 AM11/10/15
to mechanical-sympathy

Hope anyone can enlighten me about a special garbage collection notification with all the data entries being zero inside. Thanks in advance!


So what happens is that we have code to register to receive Garbage Collection JMX Notifications, something like the following:


 if (notification.getType().equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) {
            //get the information associated with this notification
            GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData());
......
}


And then we log various information (e.g., GC name, cause, duration, start/end time) from GarbageCollectionNotificationInfo we received. And recently, we received GarbageCollectionNotificationInfo with all the information being zero which does not look like an actually real GC, for example, we got the following GC: 


GC Name: ConcurrentMarkSweep GC Cause: Allocation Failure GC Action: end of major GC GC started at: 0 ms since JVM started GC ended at: 0 ms since JVM started GC duration: 0 ms The number of collections that this collector has done: 0


So I do not quite understand how this kind of "GC" could ever occur (from the above, we see this GC occurred at the same time when JVM starts), this does not actually look like a real GC at all. And before this weird GC, we have some normal GC with a positive end time and positive duration. From our log, we also noticed before the above particular example, there is a normal CMS GC at the same system time but with positive duration and end time, so this GC looks like to me a 'shadowed' one associated with the normal one, but all of these are my guess, essentially, I do not understand two things here:

  1. 1) This kind of GC with endtime = 0L and duration = 0L looks like not a real GC at all, then what is it? a shadow associated with a real GC? or some special data acts as NULL or something?
  2. 2) If this GC is not a real GC, why do we get a notification of GARBAGE_COLLECTION_NOTIFICATION type for it? When or in what cases would such a GC ever occur? 

  3. I was trying to read the source code of openJdk implementation, but unfortunately I did not find anything particularly related, or I just got a bit lost there, Really appreciate it if anyone can enlighten me a bit either about the direct details or maybe point me to some promising resources to read? Thanks!


Reply all
Reply to author
Forward
0 new messages