1

I was profiling an java process, and metrics did not seem out of place. I kept on eye on them for a couple of hours, and then I decided to turn on Object Allocation Count so I could see the rate at which new object are allocated. Somehow this caused a regime change in how my eden space grows and gets cleaned. I have no clue how to explain that, so I'll add a screen shot here:

GC Regime Change

The pink vertical line is the instant at which I enabled the tracking of object allocation. You can see that before that line, the eden space allocation is not very regular, but nothing suspicious. GC and GC pauses in the meantime are a bit frequent for me, but they still don't seem crazy high. Then past that line, you can clearly see the way the eden space grows and decreases becomes a lot smoother and regular. But more surprising is the change in GC Pauses and GC Collection. All of a sudden they became a LOT less frequent.

Has anyone any idea how this happened? It is pretty fair to say this was not a coincidence, and I'd like to understand how this profiling change had this effect. Assuming that this effect is real, I would want to be able to reproduce it without needing the profiler, so that my program spends a lot less time doing GC and GC Pauses.

Environment: Linux, Java 11, G1GC, YourKit.

MarkoPaulo
  • 474
  • 4
  • 19
  • the documentation of that "count" says that the impact is minimal from enabling it, this is rather weird. I wish I knew how this is implemented internally, what calls are done, may be that could explain it. – Eugene Mar 10 '21 at 02:23
  • Yes it is very strange. Thanks for looking into this. Really hoping someone will have some interesting insight on this. – MarkoPaulo Mar 10 '21 at 04:08

0 Answers0