0

As seen in the Monitor for memory diagram (https://i.stack.imgur.com/sBKzO.png), around 4:35PM is when I started VisualVM Profiler and it caused memory usage to drop by ~7G which is quite significant. Why did this happen? It is as if starting the profiler allowed many more memory objects to be reclaimed -- but why weren't they garbage collected in the many GC rounds before that?

(Around 4:49 is when I clicked "Snapshot" in Profiler and there was a similar drop but to a lesser extent.)

I am quite confused and would greatly appreciate if anyone can shed some light on this behavior. Thanks!

welkin
  • 37
  • 1
  • 7

1 Answers1

0

Attaching a profiler can cause more full GCs to be triggered, that would reduce the memory used briefly.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130