VisualVM Profiling of JavaFX Application
Asked Answered
S

1

6

I am trying to CPU profile a JavaFX 8 application with VisualVM (Java 8). While CPU sampling works fine, when starting CPU profiling, the application just hangs and VisualVM reports as status "profiling running (0 methods instrumented)".

I tried to limit profiling to my app´s classes, but to no avail. Am I missing something?

Streamliner answered 1/12, 2014 at 8:27 Comment(2)
PS: JDK is 1.8.0 Update 25Streamliner
jvisualvm just sucks like that. you need a profiler that can instrument the app using JVM agents that instrument it on startupPolynesian
A
3

Most probably this is caused by lambda expression(s). Currently they are constantly throwing ClassNotFoundExceptions, see the bug report over here: https://java.net/jira/browse/VISUALVM-601

Updated: With the Version 1.3.9 this issue has been resolved.

Anthropogeography answered 1/1, 2016 at 15:36 Comment(9)
It's nice to see they are at least aware of this problem, although I don't understand why it wasn't fixed yet, seeing as presumably the same problem was fixed in NetBeans, bu the same person assigned to this bug in VisualVM. However, this doesn't really help me use VisualVM to profile JavaFX applications...Grummet
@sillyfly If the same bug occurs in your application: You won't be able to use it with VisualVM until it is fixed..Anthropogeography
It happens in every JavaFX application, regardless of my own code.Grummet
That is most probably because of the JDK using lambdas too.. Did you take a look at the log files?Anthropogeography
Yes, the lambdas seem to be coming from within the JDK, which is perfectly fine and normal. Here's an example of the exceptions I'm swamped with: Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: com/sun/javafx/tk/Toolkit$$Lambda$163Grummet
I guess. What is the common SE etiquette about bounties in this case? Am I expected to award the bounty for a "there's no answer" answer? Or is the bounty to be un-awarded?Grummet
Good one. I really don't know. This here: stackoverflow.com/help/accepted-answer states: "[..]It simply means that the author received an answer that worked for him or her personally[..]Anthropogeography
Well... it didn't. Not really, as it doesn't solve the problem. It only tells me there currently can't be a solution. Still, I guess the points will go to waste otherwise, so I'll award to bounty, mostly for saving me from working hard to try more ways of solving it.Grummet
I am sorry, but I have not found any other solution. I just use a different profiler for JavaFX applications (if you are interested: do a quick google search (it starts with "your" and ends with "kit")).Anthropogeography

© 2022 - 2024 — McMap. All rights reserved.