Is it possible to control the frequency of "Full GC" in JMX (on HotSpot)?

I want to control the full GC frequency in JMX. MBean provides a GC account. (see http://download.oracle.com/javase/1.5.0/docs/api/java/lang/management/GarbageCollectorMXBean.html - java.lang: type = GarbageCollector, name =).

The problem is that MBean does not distinguish between minor and full gc.

Does anyone have any ideas?

Thanks.

Arno

+7
source share
2 answers

I'm not quite sure about this, but I assume that the garbage collector that manages all the memory pools (at least for Old Gen) is used for the main gc. For example: I have a JVM working with these 2 collectors:

  • PS MarkSweep
    • MemoryPoolNames: PS Eden Space, PS Survivor Space, PS Old Gen, PS Perm Gen
    • CollectionCount: 68
  • PS Scavenge
    • MemoryPoolNames: PS Eden Space, PS Survival Space.
    • CollectionCount: 2690

Given this, I would say PS Scavenge is used for minor gc and MarkSweep PS for the main gc.

UPDATE (based on @ajeanson's comment, thanks for the tip):

In fact, the example that I wrote down there was taken from the information open in the MXBeans JVM that I used. As you mentioned, these are GC algorithms, and the name MXBean for GC uses is based on the algorithm that GC uses. I was looking for more information about this; in this article http://download.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html reads the following:

The HotSpot Java Virtual Machine defines two generations: the young generation (sometimes called the "baby") and the old generation. The young generation consists of "Eden space" and two "survivors." The VM initially assigns all objects to the Eden space, and most objects die there. When it runs a minor GC, the virtual machine moves any remaining objects from Eden's space to one of the survivors. VM moves objects that live long enough in surviving spaces to the "occupied" space in the old generation. When a generation fills up, there is a full GC, which is often much slower because it includes all living objects. the permanent generation has all the reflective data of the virtual machine itself, such as class and method objects.

Looking at the collectionCount property on MXBeans, in the case of my collector "PS MarkSweep" (managing the old generation pool), the collection count only increases when I get the full GC in verbose output. Perhaps I am mistaken, and perhaps in some cases this collector also performs a small GC, but I would have to conduct more tests to be absolutely sure of it. Please let me know if someone finds out something else or you have more specific information about this problem, as I am very interested in it.

+8
source

he ... looks at the names, for example. ParNew, ConcurrentMarkSweep, .. etc. some names for younger gc, some for full gc,

0
source

All Articles