Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access Profiler tab #621

Open
fedecasanova72 opened this issue Jan 30, 2025 · 5 comments
Open

Can't access Profiler tab #621

fedecasanova72 opened this issue Jan 30, 2025 · 5 comments
Labels

Comments

@fedecasanova72
Copy link

Describe the bug
I'm running locally my java application with java 21, using these VM options:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.rmi.port=9010
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

I can attach the visualvm to the process, but there's no Profiler tab and the options in the menu related to the Profiler are disabled.

To Reproduce
It happens with any java application that I run, locally or remotely.
Somehow, I've seen it work recently once, but I cannot replicate it anymore, now it's always disabled...

Expected behavior
There should be a Profiler tab.

VisualVM log

-------------------------------------------------------------------------------
>Log Session: Thursday, January 30, 2025, 12:18:21 PM Central European Standard Time
>System Info: 
  Product Version         = VisualVM 2.1.10
  Operating System        = Linux version 6.8.0-52-generic running on amd64
  Java; VM; Vendor        = 21.0.5; OpenJDK 64-Bit Server VM 21.0.5+11-Ubuntu-1ubuntu122.04; Ubuntu
  Runtime                 = OpenJDK Runtime Environment 21.0.5+11-Ubuntu-1ubuntu122.04
  Java Home               = /usr/lib/jvm/java-21-openjdk-amd64
  System Locale; Encoding = en_US (visualvm); UTF-8
  Home Directory          = /home/fede
  Current Directory       = /home/fede
  User Directory          = /home/fede/.visualvm/2.1.10
  Cache Directory         = /home/fede/.cache/visualvm/2.1.10
  Installation            = /opt/visualvm_2110/visualvm
                            /opt/visualvm_2110/platform
  Boot & Ext. Classpath   = 
  Application Classpath   = /opt/visualvm_2110/platform/lib/boot.jar:/opt/visualvm_2110/platform/lib/org-openide-modules.jar:/opt/visualvm_2110/platform/lib/org-openide-util.jar:/opt/visualvm_2110/platform/lib/org-openide-util-lookup.jar:/opt/visualvm_2110/platform/lib/org-openide-util-ui.jar
  Startup Classpath       = /opt/visualvm_2110/platform/core/org-openide-filesystems.jar:/opt/visualvm_2110/platform/core/core-base.jar:/opt/visualvm_2110/platform/core/core.jar:/opt/visualvm_2110/platform/core/asm-commons-9.7.jar:/opt/visualvm_2110/platform/core/org-netbeans-libs-asm.jar:/opt/visualvm_2110/platform/core/asm-9.7.jar:/opt/visualvm_2110/platform/core/asm-tree-9.7.jar:/opt/visualvm_2110/visualvm/core/org-graalvm-visualvm-modules-startup.jar:/opt/visualvm_2110/visualvm/core/locale/core_visualvm.jar
-------------------------------------------------------------------------------
INFO [org.netbeans.core.startup.NbEvents]: Turning on modules:
	org.openide.util.lookup [8.58 20240628-0d0bfcf3fa]
	org.openide.util [9.32 20240628-0d0bfcf3fa]
	org.openide.util.ui [9.33 20240628-0d0bfcf3fa]
	org.openide.modules [7.72 20240628-0d0bfcf3fa]
	org.netbeans.api.annotations.common/1 [1.52 20240628-0d0bfcf3fa]
	org.openide.filesystems [9.37 20240628-0d0bfcf3fa]
	org.openide.awt [7.92 20240628-0d0bfcf3fa]
	org.netbeans.api.progress/1 [1.72 20240628-0d0bfcf3fa]
	org.netbeans.api.progress.nb [1.72 20240628-0d0bfcf3fa]
	org.openide.dialogs [7.71 20240628-0d0bfcf3fa]
	org.openide.nodes [7.69 20240628-0d0bfcf3fa]
	org.openide.windows [6.101 20240628-0d0bfcf3fa]
	org.netbeans.modules.editor.mimelookup/1 [1.64 20240628-0d0bfcf3fa]
	org.openide.text [6.92 20240628-0d0bfcf3fa]
	org.netbeans.api.scripting [1.21 20240628-0d0bfcf3fa]
	org.netbeans.swing.tabcontrol [1.81 20240628-0d0bfcf3fa]
	org.netbeans.swing.outline [1.58 20240628-0d0bfcf3fa]
	org.openide.explorer [6.86 20240628-0d0bfcf3fa]
	org.openide.actions [6.63 20240628-0d0bfcf3fa]
	org.netbeans.modules.queries/1 [1.67 20240628-0d0bfcf3fa]
	org.netbeans.api.templates [1.32 20240628-0d0bfcf3fa]
	org.openide.filesystems.nb [9.34 20240628-0d0bfcf3fa]
	org.openide.loaders [7.94 20240628-0d0bfcf3fa]
	org.netbeans.api.intent [1.26 20240628-0d0bfcf3fa]
	org.netbeans.api.io [1.27 20240628-0d0bfcf3fa]
	org.openide.io [1.73 20240628-0d0bfcf3fa]
	org.netbeans.swing.plaf [1.66 20240628-0d0bfcf3fa]
	org.netbeans.modules.keyring [1.48 20240628-0d0bfcf3fa]
	org.netbeans.libs.asm [5.27 20240628-0d0bfcf3fa]
	org.netbeans.bootstrap/1 [2.103 20240628-0d0bfcf3fa]
	org.netbeans.core.startup.base [1.86.0.1 1 20240628-0d0bfcf3fa]
	org.netbeans.core.startup/1 [1.87.0.1 20240628-0d0bfcf3fa]
	org.netbeans.modules.sampler [1.38 20240628-0d0bfcf3fa]
	org.netbeans.core/2 [3.75 20240628-0d0bfcf3fa]
	org.netbeans.spi.quicksearch [1.51 20240628-0d0bfcf3fa]
	org.netbeans.modules.options.api/1 [1.69 20240628-0d0bfcf3fa]
	org.netbeans.libs.flatlaf/1 [1.18 3.3 20240628-0d0bfcf3fa]
	org.netbeans.swing.laf.flatlaf [1.17 20240628-0d0bfcf3fa]
	org.netbeans.modules.settings/1 [1.73 20240628-0d0bfcf3fa]
	org.netbeans.modules.sendopts/2 [2.60 20240628-0d0bfcf3fa]
	org.netbeans.modules.progress.ui [1.57 20240628-0d0bfcf3fa]
	org.netbeans.modules.options.keymap [1.61 20240628-0d0bfcf3fa]
	org.netbeans.modules.masterfs/2 [2.79.0.2 2 20240628-0d0bfcf3fa]
	org.netbeans.modules.masterfs.ui [2.27.0.2 20240628-0d0bfcf3fa]
	org.netbeans.modules.masterfs.nio2 [1.39 20240628-0d0bfcf3fa]
	org.netbeans.libs.jna/2 [2.19 20240628-0d0bfcf3fa]
	org.netbeans.modules.masterfs.linux [1.37 20240628-0d0bfcf3fa]
	org.netbeans.modules.keyring.fallback [1.32 20240628-0d0bfcf3fa]
	org.netbeans.modules.keyring.impl [1.48 20240628-0d0bfcf3fa]
	org.netbeans.modules.editor.mimelookup.impl/1 [1.56 20240628-0d0bfcf3fa]
	org.netbeans.modules.autoupdate.services [1.80 20240628-0d0bfcf3fa]
	org.netbeans.modules.autoupdate.ui [1.70 20240628-0d0bfcf3fa]
	org.netbeans.modules.autoupdate.cli [1.38 20240628-0d0bfcf3fa]
	org.netbeans.libs.jna.platform/2 [2.19 20240628-0d0bfcf3fa]
	org.netbeans.core.windows/2 [2.109 20240628-0d0bfcf3fa]
	org.netbeans.core.ui/1 [1.69 20240628-0d0bfcf3fa]
	org.netbeans.core.network [1.36 20240628-0d0bfcf3fa]
	org.netbeans.core.nativeaccess/1 [1.55 20240628-0d0bfcf3fa]
	org.netbeans.core.multitabs/1 [1.36.0.1 1 20240628-0d0bfcf3fa]
	org.netbeans.core.io.ui/1 [1.54 20240628-0d0bfcf3fa]
	org.graalvm.visualvm.lib.jfluid/2 [2.18 240911]
	org.graalvm.visualvm.lib.charts/2 [2.1 240911]
	org.graalvm.visualvm.lib.common/2 [2.11 240911]
	org.graalvm.visualvm.lib.profiler.api/2 [2.2 240911]
	org.graalvm.visualvm.lib.ui/2 [2.4 240911]
	org.graalvm.visualvm.uisupport/2 [2.1 240911]
	org.graalvm.visualvm.core/2 [2.4 240911]
	org.graalvm.visualvm.host/2 [2.1 240911]
	org.graalvm.visualvm.application/2 [2.4 240911]
	org.graalvm.visualvm.tools/2 [2.3 240911]
	org.graalvm.visualvm.coredump/2 [2.1 240911]
	org.graalvm.visualvm.threaddump/2 [2.1 240911]
	org.graalvm.visualvm.lib.profiler.utilities/2 [2.0 240911]
	org.graalvm.visualvm.lib.profiler.attach/2 [2.3 240911]
	org.graalvm.visualvm.lib.profiler/2 [2.4 240911]
	org.graalvm.visualvm.lib.profiler.snaptracer/2 [2.0 240911]
	org.graalvm.visualvm.profiling/2 [2.3 240911]
	org.graalvm.visualvm.lib.jfluid.heap [1.3 240911]
	org.graalvm.visualvm.lib.profiler.oql/2 [2.0 240911]
	org.graalvm.visualvm.lib.profiler.heapwalker/2 [2.2 240911]
	org.graalvm.visualvm.heapviewer/2 [2.8 240911]
	org.graalvm.visualvm.heapdump/2 [2.1 240911]
	org.graalvm.visualvm.sampler.truffle/2 [2.1 240911]
	org.graalvm.visualvm.sampler/2 [2.2 240911]
	org.graalvm.visualvm.sa/2 [2.0 240911]
	org.graalvm.visualvm.modules.startup/2 [2.1 240911]
	org.graalvm.visualvm.profiler/2 [2.1 240911]
	org.graalvm.visualvm.profiler.startup/2 [2.0 200207]
	org.graalvm.visualvm.pluginimporter [1.0 240911]
	org.graalvm.visualvm.charts/2 [2.1 240911]
	org.graalvm.visualvm.application.views/2 [2.1 240911]
	org.graalvm.visualvm.modules.threadinspect/2 [2.0 200207]
	org.graalvm.visualvm.modules.nashorn.jdk15 [1.1 240911]
	org.graalvm.visualvm.modules.buffermonitor/2 [2.0 200207]
	org.graalvm.visualvm.modules.appui/2 [2.1 240911]
	org.graalvm.visualvm.jvmstat/2 [2.0 240911]
	org.graalvm.visualvm.jvm/2 [2.0 240911]
	org.graalvm.visualvm.jmx/2 [2.2 240911]
	org.graalvm.visualvm.jfr/2 [2.3 240911]
	org.graalvm.visualvm.jfr.jdk11/2 [2.2 240911]
	org.graalvm.visualvm.jfr.generic/2 [2.5 240911]
	org.graalvm.visualvm.host.views/2 [2.0 240911]
	org.graalvm.visualvm.host.remote/2 [2.0 240911]
	org.graalvm.visualvm.heapviewer.truffle/2 [2.1 240911]
	org.graalvm.visualvm.heapviewer.console/2 [2.0 240911]
	org.graalvm.visualvm.graalvm/2 [2.0 240911]
	org.graalvm.visualvm.gotosource/2 [2.0 240911]
	org.graalvm.visualvm.attach/2 [2.0 240911]
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy resolver: Gnome
INFO [org.netbeans.core.network.proxy.gnome.GsettingsNetworkProxy]: GSettings system proxy resolver: direct connection
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy reloading succeeded.
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - mode: direct
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy: fell to default (correct if direct mode went before)
INFO [org.netbeans.ui.metrics.laf]: USG_LOOK_AND_FEEL
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.graalvm.visualvm.jvmstat.application.JvmstatApplicationProvider$1
java.lang.IllegalArgumentException: Could not find MonitoredHost for scheme: local
	at jdk.internal.jvmstat/sun.jvmstat.monitor.MonitoredHost.getMonitoredHost(MonitoredHost.java:177)
	at org.graalvm.visualvm.jvmstat.application.JvmstatApplicationProvider.getMonitoredHost(JvmstatApplicationProvider.java:370)
	at org.graalvm.visualvm.jvmstat.application.JvmstatApplicationProvider.registerJvmstatConnection(JvmstatApplicationProvider.java:261)
	at org.graalvm.visualvm.jvmstat.application.JvmstatApplicationProvider.registerJvmstatConnections(JvmstatApplicationProvider.java:126)
	at org.graalvm.visualvm.jvmstat.application.JvmstatApplicationProvider.processNewHost(JvmstatApplicationProvider.java:119)
	at org.graalvm.visualvm.jvmstat.application.JvmstatApplicationProvider.access$000(JvmstatApplicationProvider.java:72)
	at org.graalvm.visualvm.jvmstat.application.JvmstatApplicationProvider$1.run(JvmstatApplicationProvider.java:98)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1420)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2035)
Diagnostic information
Input arguments:
	-Djdk.home=/usr/lib/jvm/java-21-openjdk-amd64
	-Dnetbeans.default_userdir_root=/home/fede/.visualvm
	-Dnetbeans.running.environment=gnome
	-Dnetbeans.dirs=/opt/visualvm_2110/visualvm:
	-Dnetbeans.home=/opt/visualvm_2110/platform
	-Xms24m
	-Xmx768m
	-Dnetbeans.accept_license_class=org.graalvm.visualvm.modules.startup.AcceptLicense
	-Dnetbeans.importclass=org.graalvm.visualvm.modules.startup.ImportSettings
	-Dsun.jvmstat.perdata.syncWaitMs=10000
	-Dsun.java2d.noddraw=true
	-Dsun.java2d.d3d=false
	-Dorg.netbeans.core.TimeableEventQueue.quantum=360000
	-Dpolyglot.js.nashorn-compat=true
	-Dsun.misc.URLClassPath.disableJarChecking=true
	-Djdk.attach.allowAttachSelf=true
	-Dorg.openide.util.ImageUtilities.level=950
	--add-exports=java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED
	--add-exports=java.desktop/sun.awt=ALL-UNNAMED
	--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor.event=ALL-UNNAMED
	--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
	--add-exports=java.desktop/sun.swing=ALL-UNNAMED
	--add-exports=jdk.attach/sun.tools.attach=ALL-UNNAMED
	--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED
	--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED
	--add-opens=java.base/java.net=ALL-UNNAMED
	--add-opens=java.base/java.lang.ref=ALL-UNNAMED
	--add-opens=java.base/java.lang=ALL-UNNAMED
	--add-opens=java.desktop/javax.swing=ALL-UNNAMED
	--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
	-XX:+IgnoreUnrecognizedVMOptions
	-Dnetbeans.logger.console=true
	-XX:+HeapDumpOnOutOfMemoryError
	-XX:HeapDumpPath=/home/fede/.visualvm/2.1.10/var/log/heapdump.hprof
	-Djava.security.manager=allow
Compiler: HotSpot 64-Bit Tiered Compilers
Heap memory usage: initial 24.0MB maximum 768.0MB
Non heap memory usage: initial 7.3MB maximum -1b
Garbage collector: G1 Young Generation (Collections=10 Total time spent=0s)
Garbage collector: G1 Concurrent GC (Collections=6 Total time spent=0s)
Garbage collector: G1 Old Generation (Collections=0 Total time spent=0s)
Classes: loaded=7085 total loaded=7085 unloaded 0
INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 16,584,699,904
INFO [null]: Total physical memory 16,584,699,904

Screenshots
Image

Image

Desktop (please complete the following information):

Version: 2.1.10 (Build 240911); platform 20240628-0d0bfcf3fa
System: Linux (6.8.0-52-generic) , amd64 64bit
Java: 21.0.5; OpenJDK 64-Bit Server VM (21.0.5+11-Ubuntu-1ubuntu122.04, mixed mode, sharing)
Vendor: Ubuntu, https://ubuntu.com/
Environment: UTF-8; en_US (visualvm)
Clusters:
/opt/visualvm_2110/platform
/opt/visualvm_2110/visualvm
@thurka
Copy link
Member

thurka commented Jan 30, 2025

I can attach the visualvm to the process

How do you attach to the process?

It happens with any java application that I run, locally or remotely.

Note that profiler tab is available only for local processes running under same user as VisualVM.

@fedecasanova72
Copy link
Author

I attach it through "Add JMX connection" (or if it appears directly for local processes, which not always work).

Oh, I didn't know that Profiler only works for local processes... I just tried now again and the tab appeared for local process... It's strange that sometimes does, and sometimes does not.

Is it impossible for remotely running processes? Not even with an agent installed or something?

Thank you.

@thurka
Copy link
Member

thurka commented Jan 31, 2025

I attach it through "Add JMX connection"

If you need to use JMX, it means that this is not the local process running under same user as VisualVM. Local processes are automatically detected and displayed next to VisualVM itself.

Oh, I didn't know that Profiler only works for local processes... I just tried now again and the tab appeared for local process... It's strange that sometimes does, and sometimes does not.

Automatically detected processes should have profiler tab. If not, this is something, which should be investigated. Can you narrow down the case, where it does not appears?

Is it impossible for remotely running processes? Not even with an agent installed or something?

Currently this is not supported by VisualVM - the usual workaround is to run VisualVM on remote machine and use vnc or rdp to display it locally.

@johnharby
Copy link

I can't seem to calibrate the JVM. I'm using Amazon Corretto-17.0.13.11.1 (build 17.0.13+11-LTS) (Open JDK 17), we're on AWS. Is this an unsupported version or is there a workaround?

@thurka
Copy link
Member

thurka commented Feb 10, 2025

I can't seem to calibrate the JVM. I'm using Amazon Corretto-17.0.13.11.1 (build 17.0.13+11-LTS) (Open JDK 17), we're on AWS. Is this an unsupported version or is there a workaround?

Amazon Corretto should work fine. Please file separate issue and provide more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants