visualvm icon indicating copy to clipboard operation
visualvm copied to clipboard

Clicking on Sampler view causes a GC_HeapInspection event

Open joshb1050 opened this issue 6 months ago • 0 comments

Describe the bug

We noticed that in the GC logs of the Java process that there is a GC_HeapInspection event triggered just by opening up the "Sampler" tab in VisualVM. I think this is perhaps due to a JFR that gets eagerly captured on clicking this tab that ends up being extremely expensive and can stop out the Java process as it inspects the heap.

To Reproduce Steps to reproduce the behavior:

  1. Grep for GC_HeapInspection in GC logs (flags)
gc+stats=debug,gc+alloc=debug,safepoint=info,ergo=info,free=info,director=info:file=gc.log
  1. Should see no results initially.
  2. Connect via JMX to the process.
  3. Again, grep for GC_HeapInspection, should see no results upon initial connect.
  4. Click the "Sampler" tab.
  5. Grep for GC_HeapInspection. Should see a log entry for this.

Expected behavior

Just clicking on the tab should not trigger anything. This would only be expected on actually trying to sample memory or CPU.

Desktop (please complete the following information):

  • OS:MacOS 15.3
  • JDK version: 17.0.11; OpenJDK 64-Bit Server VM (17.0.11+9-LTS, mixed mode, sharing)
  • Version: 2.1.10 (Build 240911)

joshb1050 avatar Jun 18 '25 15:06 joshb1050