Tried to use the profiler today, but it does not seem to connect to the application.
Application is a NetBeans suite and it is composed by several modules.
I launch the suite normally from the project area in NetBeans IDE: right-click
on the parent node of the suite and choose "Run" from the contextual menu. It
always works fine.
But if i click "Profile" something starts and after a bit teh IDE shows the
Profiler Area, after which, a progress window pops up and stays forever spinning
saying: "Connecting to the target VM...". After 10 minutes or so, a dialog pops
up saying "Failed to establish socket connection with the target JVM".
Tried the profiler on a dummy java application and it works fine.
Using jdk 1.5 update 6 as instructed, for both the suite and the profiler.
Created attachment 30150 [details]
final dialog that shows after the timeout on connecting to the JVM
Created attachment 30151 [details]
messages.log of NetBeans IDE 5
Created attachment 30185 [details]
output window in NetBeans IDE
Last attachment posted is what NetBeans IDE writes in its output window after i
launch the profiler on my suite.
The last line says:
Could not find agent library in absolute path: C:/Program
which is obviously incorrect, because that MS Windows path contains a space
But why does it do that on a Suite Module project type, while for a Java
Application project type works fine?
Reinstalled both Java and NetBeans today under a directory different from
"Program Files", containing no spaces: c:\Java\netbeans-5.0.
Profiler now connects to the JVM, and works when you pick "Monitor Application",
but still has problems connecting to the JVM when choosing the other options
available: Analyze performance, Analyze Code Fragment Performance, Analyze
memory Usage, Run Custom Profiling.
Summarizing all i found about this issue here:
1) if NetBeans is installed in a directory like "c:\Program Files\netbeans" the
profiler does not work, apparently because it cannot resolve a path that contain
2) the profiler cannot profile the entire branded application. If you choose
"Analyze Performance" and then click the radio button "Entire Application", the
Take a snapshot button is grayed out. So, you cannot profile the entire
application. It only works when you select a portion of the application to
profile (radio button "Part of Application", button "Select..."). In that case,
the Take snapshot button is enabled.
As of 1) This is a duplicate of #72941
As of 2) I suppose your project is pretty big and when you are trying to profile
the entire application it would require to load and instrument thousands of
classes which can take a serious amount of time. The "Take snapshot" button is
grayed out because there are no results available - the engine is busy with
instrumenting methods. I would suggest using the "Part of Application" mode to
lower the number of methods being instrumented at the startup.
*** This issue has been marked as a duplicate of 72941 ***
target milestone changed