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

VisualVM not profiling #29

Open
4ntoine opened this issue Jul 23, 2019 · 12 comments
Open

VisualVM not profiling #29

4ntoine opened this issue Jul 23, 2019 · 12 comments

Comments

@4ntoine
Copy link

4ntoine commented Jul 23, 2019

I'm trying to run the test on Intellij idea 2019.1.3 CE on mac.
I can see VisualVM is starting but showing error "cannot open requested application":

Снимок экрана 2019-07-23 в 12 23 11

$java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Any thoughts?

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

Tried default jvm visualvm:

Снимок экрана 2019-07-23 в 13 48 05

and 1.4.3 installed manually:

Снимок экрана 2019-07-23 в 13 49 20

@krasa
Copy link
Owner

krasa commented Jul 23, 2019

Maybe -Dvisualvm.id=... does not match.

Does this button work? https://user-images.githubusercontent.com/1160875/61697788-4c37a600-ad38-11e9-860f-7c2ade17ea39.png

Does VisualVM even show that process?

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

FYI just tried for IDEA 2018.2.8 - getting the same error. The button works and VisualVM is started but getting the same error right after it.

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

Can you explain more about -Dvisualvm.id=... ?

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

Does VisualVM even show that process?

Yup:
Снимок экрана 2019-07-23 в 16 31 24

@krasa
Copy link
Owner

krasa commented Jul 23, 2019

If you enable debug log ( Menu | Help | Debug Log...) for krasa.visualvm you should see something like this:

2019-07-23 14:51:08,542 [10545065]  DEBUG -       krasa.visualvm.LogHelper - DebugVisualVMRunner: #createContentDescriptor
2019-07-23 14:51:08,545 [10545068]  DEBUG -       krasa.visualvm.LogHelper - DebugVisualVMRunner: #createContentDescriptor -Dvisualvm.id=681312417627178
2019-07-23 14:51:08,545 [10545068]  DEBUG -       krasa.visualvm.LogHelper - VisualVMJavaProgramPatcher: #patchJavaParameters start
2019-07-23 14:51:08,545 [10545068]  DEBUG -       krasa.visualvm.LogHelper - VisualVMJavaProgramPatcher: Patching: jdkPath=null; appId=681315535965486
2019-07-23 14:51:08,545 [10545068]  DEBUG - krasa.visualvm.VisualVMContext - saving context: VisualVMContext{appId=681315535965486}
2019-07-23 14:51:08,557 [10545080]  DEBUG -       krasa.visualvm.LogHelper - StartVisualVMConsoleAction: created with VisualVMContext{appId=681315535965486}
2019-07-23 14:51:08,581 [10545104]  DEBUG -       krasa.visualvm.LogHelper - DebugVisualVMRunner: #attachVirtualMachine
2019-07-23 14:51:08,581 [10545104]  DEBUG -       krasa.visualvm.LogHelper - DebugVisualVMRunner: starting VisualVM with id=681312417627178
2019-07-23 14:51:19,283 [10555806]  DEBUG -       krasa.visualvm.LogHelper - StartVisualVMConsoleAction: created with VisualVMContext{appId=681315535965486}

That's how VisualVM knows which app to open.
Sometimes there are 2 ids and only one of them is being used, that's fine. But it is possible that some other id from some other process is being used for starting VisualVM.

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

Снимок экрана 2019-07-23 в 18 14 19

Nothing in the log:
Снимок экрана 2019-07-23 в 18 16 55

But i can see ids in cmd:

/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:55012,suspend=y,server=n -Dvisualvm.id=883655423944663 -ea -Didea.test.cyclic.buffer.size=1048576 -Dvisualvm.id=883642351419808 ...

@krasa
Copy link
Owner

krasa commented Jul 23, 2019

IntelliJ log. 'Help| Show Log in explorer or something.'

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

yup, i can see it:

2019-07-23 18:06:22,657 [23681771]  DEBUG -       krasa.visualvm.LogHelper - StartVisualVMConsoleAction: created with VisualVMContext{appId=882071234567842} 
2019-07-23 18:06:22,661 [23681775]  DEBUG -       krasa.visualvm.LogHelper - StartVisualVMConsoleAction: created with VisualVMContext{appId=882071234567842} 
2019-07-23 18:06:27,736 [23686850]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 60 ms 
2019-07-23 18:06:29,508 [23688622]   INFO - ild.invoker.GradleBuildInvoker - Gradle build finished in 6 s 898 ms 
2019-07-23 18:06:29,536 [23688650]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2019-07-23 18:06:29,554 [23688668]  DEBUG -       krasa.visualvm.LogHelper - VisualVMJavaProgramPatcher: #patchJavaParameters start 
2019-07-23 18:06:29,555 [23688669]  DEBUG -       krasa.visualvm.LogHelper - VisualVMJavaProgramPatcher: Patching: jdkPath=null; appId=882975128538931 
2019-07-23 18:06:29,555 [23688669]  DEBUG - krasa.visualvm.VisualVMContext - saving context: VisualVMContext{appId=882975128538931} 
2019-07-23 18:06:29,557 [23688671]  DEBUG -       krasa.visualvm.LogHelper - StartVisualVMConsoleAction: created with VisualVMContext{appId=882975128538931} 
2019-07-23 18:06:29,663 [23688777]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2019-07-23 18:06:29,696 [23688810]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2019-07-23 18:06:29,788 [23688902]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 1ms; general responsiveness: ok; EDT responsiveness: ok 
2019-07-23 18:06:29,825 [23688939]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 37ms; general responsiveness: ok; EDT responsiveness: ok 
2019-07-23 18:06:36,025 [23695139]  DEBUG - krasa.visualvm.VisualVMContext - saving context: VisualVMContext{appId=882981599267630} 
2019-07-23 18:06:36,027 [23695141]  DEBUG -       krasa.visualvm.LogHelper - RunVisualVMRunner: #execute 
2019-07-23 18:06:36,069 [23695183]   INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: [:compat:generateDebugSources, :compat:generateDebugAndroidTestSources, :compat:createMockableJar, :compat:compileDebugAndroidTestSources, :compat:compileDebugUnitTestSources, :compat:compileDebugSources] 
2019-07-23 18:06:36,074 [23695188]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home 
2019-07-23 18:06:36,075 [23695189]   INFO - ild.invoker.GradleBuildInvoker - Build command line options: [-Pandroid.injected.invoked.from.ide=true] 
2019-07-23 18:06:36,078 [23695192]   INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Pandroid.injected.invoked.from.ide=true 
2019-07-23 18:06:36,120 [23695234]  DEBUG -       krasa.visualvm.LogHelper - StartVisualVMConsoleAction: created with VisualVMContext{appId=882981599267630} 
2019-07-23 18:06:36,123 [23695237]  DEBUG -       krasa.visualvm.LogHelper - StartVisualVMConsoleAction: created with VisualVMContext{appId=882981599267630} 

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

anything i can check to help you fix it?

@krasa
Copy link
Owner

krasa commented Jul 23, 2019

Do you have an example project?
I've tried gradle+kotlin and it worked fine, except when it would not support VisualVM and YourKit at all, since it runned tests via gradle goals only.

@4ntoine
Copy link
Author

4ntoine commented Jul 23, 2019

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

No branches or pull requests

2 participants