What does “garbage collection rate” mean and what benefits can it provide?

When analyzing the behavior of the Java GC, some tools have a metric "garbage collection speed" (an example will be shown in Figure 19. from http://www.ibm.com/developerworks/java/library/j-ibmtools2/#fig19 ), the unit of which is MB / sec.

This is rarely an indicator compared to others, for example, the use of GC. This is similar to how fast the GC clears. But does it give any benefit? Or how best to analyze it?

+4
source share
4 answers

Besides the obvious use of this indicator to understand the use of objects with short objects, most tools with this indicator, the garbage collection rate in MB / s, use it as a way to measure application performance.

The assumption made is that every garbage collection is equal to the generated garbage, which also shows how well the applications work (the more efficient applications work faster than the garbage generates). Typically, these tools compare this indicator with different versions of the program to determine which ones are more effective (the higher the number, the better).

A typical use case will compare before / after its number to fix the code. If the number increases, this usually (you know, not always) means better.

0
source

You may find it used to identify some of the causes of slower JVMs in performance analysis.
(Extract, emphasis mine)

generational level of garbage collection .
Remember that Suns virtual machines (1. 3+) are generations and that the heap is broken down into "young generation and" old generation according to the age of the object. "
By default, two different GC algorithms are used to control each of the two generations;

  • the younger generation uses a copy collector and
  • the old generation uses the Mark Compact Collector.

The specifics of these and other GC algorithms mentioned in this blog can be found in the excellent article about the Suns Turbo-charged Java Virtual Machine .

alt text
(source: decaresystems.ie )

[...] How can we determine what impact this increased old-generation GC activity had on the application?
Well, if we compare the data that we now know with another PerformaSure chart; On the GC Overhead graph, we can determine the effect of increased GC activity.

We clearly see that overhead is growing in tandem with the old-generation GC speed, eventually reaching an overhead level of 100%.
Referring to the graph of the number of active sessions, we see that the increase in GC activity and related service data actually coincides with the connection of another user community to the network, increasing the number of simultaneous active sessions from approximately 200 to 250, depending on the circumstances and workload. sometimes 300 sessions.

+1
source

Yes, looking at garbage collection speed, it makes sense if your goal is to scale to support many users in parallel.

Using a unit of MB / s is usually not very useful.

I usually recommend trying to stay less than 10 MB for user interaction.

You need to be careful not to try to minimize garbage too much, because it may happen that you can limit concurrency. Markus ( http://kohlerm.blogspot.com/ )

+1
source

Since this is MB / sec, I would suggest that it means "MB of memory freed up by garbage collection per second."

As for how significant it is: the chart you are attached to also contains the “number of garbage collectors” and “average garbage pause [ms]”. You should look at all these numbers together to find out if there is a problem.

The metric itself probably just shows if you use a lot of “temporary” objects (so that you can free up large chunks) or not. If you have many pauses and starts of the collection, but only relatively few MB are freed, you reach the memory capacity and must either add more memory or reduce the consumption of your content.

0
source

All Articles