oracle / oracle/visualvm

Fails to show VisualGC for ZGC

Open
#261 5 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
3.3k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When running a large java app using the ZGC garbage collector, the VisualVM tab VisualGC falsely claims it doesn't support the running JVM (whereas actually, it's the chosen GC that represents a problem).

To Reproduce
Steps to reproduce the behavior:
1 Start VisualVM
2 Start a JVM app using the commandline option -XX+UseZGC
3 Find the newly started app in VisualVM and click the VisualGC tab
4 See error

Expected behavior
A very nice graphical representation of the current state of the memory use should be displayed

VisualVM log
INFO [com.sun.jvmstat.tools.visualgc.VisualGCView]: Could not create GCSample
java.lang.NullPointerException: Cannot invoke "sun.jvmstat.monitor.LongMonitor.longValue()" because "this.edenSize" is null
at com.sun.jvmstat.tools.visualgc.MonitoredVmModel.getNewGenMaxSize(MonitoredVmModel.java:250)
at com.sun.jvmstat.tools.visualgc.GCSample.(GCSample.java:131)
[catch] at com.sun.jvmstat.tools.visualgc.VisualGCView.initializeModel(VisualGCView.java:218)
at com.sun.jvmstat.tools.visualgc.VisualGCView.(VisualGCView.java:103)
at org.graalvm.visualvm.modules.visualgc.VisualGCViewProvider.createView(VisualGCViewProvider.java:26)
at org.graalvm.visualvm.modules.visualgc.VisualGCViewProvider.createView(VisualGCViewProvider.java:19)
at org.graalvm.visualvm.core.ui.DataSourceViewProvider.getView(DataSourceViewProvider.java:103)
at org.graalvm.visualvm.core.ui.DataSourceViewsManager.getViews(DataSourceViewsManager.java:137)
at org.graalvm.visualvm.core.ui.DataSourceWindowManager.openWindowAndAddView(DataSourceWindowManager.java:263)
at org.graalvm.visualvm.core.ui.DataSourceWindowManager.access$000(DataSourceWindowManager.java:53)
at org.graalvm.visualvm.core.ui.DataSourceWindowManager$2.run(DataSourceWindowManager.java:122)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

Desktop (please complete the following information):

  • OS: Ubuntu 20.10 and Ubuntu 20.04
  • JDK version JDK 15
  • VisualVM version 2.0.5

Additional context
Very cold weather today

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MonitoredVmModel.java at getNewGenMaxSize, then read GCSample.java and VisualGCView.java around the reported stack trace. Reproduce with a Java 15 application using -XX+UseZGC and open VisualGC; done means the tab no longer falsely reports unsupported JVM behavior or fails with the shown NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.