visualvm
visualvm copied to clipboard
[win] VisualVm hangs
windows 10. Sometime whens i want to connect to JVM VisualVM freezes until connection is established - which can take incredible amount of time especially if the JVM connecting to is running into low memory. Today it happend when i was trying to connect to a JVM running in Junit test that terminated around the same time. VisualVm could not recover, even though the process i tried conncecting to is already terminated for ages: stacktrace of freeze:
"AWT-EventQueue-0" #22 prio=6 os_prio=0 tid=0x0000000029442800 nid=0x4148 runnable [0x000000002b7fc000]
java.lang.Thread.State: RUNNABLE
at sun.tools.attach.WindowsVirtualMachine.connectPipe(Native Method)
at sun.tools.attach.WindowsVirtualMachine.execute(WindowsVirtualMachine.java:100)
at sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualMachine.java:261)
at sun.tools.attach.HotSpotVirtualMachine.executeJCmd(HotSpotVirtualMachine.java:243)
at org.graalvm.visualvm.attach.AttachModelImpl.executeJCmd(AttachModelImpl.java:213)
- locked <0x00000007632f1da0> (a org.graalvm.visualvm.attach.AttachModelImpl)
at org.graalvm.visualvm.attach.AttachModelImpl.executeJCmd(AttachModelImpl.java:182)
at org.graalvm.visualvm.jfr.model.impl.JfrModelImpl.executeJCmd(JfrModelImpl.java:216)
at org.graalvm.visualvm.jfr.model.impl.JfrModelImpl.isJfrAvailable(JfrModelImpl.java:86)
at org.graalvm.visualvm.jfr.model.impl.JfrModelProvider.createModelFor(JfrModelProvider.java:43)
at org.graalvm.visualvm.jfr.model.impl.JfrModelProvider.createModelFor(JfrModelProvider.java:39)
at org.graalvm.visualvm.core.model.ModelFactory.getModel(ModelFactory.java:105)
- locked <0x00000007631c4fe8> (a org.graalvm.visualvm.jvmstat.application.JvmstatApplication)
at org.graalvm.visualvm.tools.jfr.JfrModelFactory.getJFRFor(JfrModelFactory.java:64)
at org.graalvm.visualvm.jvm.JVMImpl.isJfrAvailable(JVMImpl.java:495)
at org.graalvm.visualvm.jfr.JFRSnapshotSupport.supportsJfrStop(JFRSnapshotSupport.java:192)
at org.graalvm.visualvm.jfr.impl.JFRStopAction.isEnabled(JFRStopAction.java:95)
at org.graalvm.visualvm.core.ui.actions.MultiDataSourceAction.updateState(MultiDataSourceAction.java:76)
at org.graalvm.visualvm.jfr.impl.JFRStopAction.updateState(JFRStopAction.java:117)
at org.graalvm.visualvm.core.ui.actions.DataSourceAction$1.selectionChanged(DataSourceAction.java:87)
at org.graalvm.visualvm.core.explorer.ExplorerSupport$ExplorerTreeSelectionListener.valueChanged(ExplorerSupport.java:272)
at javax.swing.JTree.fireValueChanged(JTree.java:2934)
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3398)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:635)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1093)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:294)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:188)
at javax.swing.JTree.setSelectionPath(JTree.java:1641)
at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.java:2393)
at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3609)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3548)
at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
at java.awt.Component.processMouseEvent(Component.java:6536)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at org.graalvm.visualvm.core.explorer.ExplorerComponent$1.processMouseEvent(ExplorerComponent.java:110)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
would be nice if that dangerous connection would be done in another thread, so that not the whole VisualVM freezes