This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 147597 [details] Maven profiler log Product Version: NetBeans IDE Dev (Build 201405310001) Java: 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev I can launch a "Quick" profiler session just fine, but when I select Advanced (instrumented) profiling I get the attached exception. Two seconds later I get a pop-up dialog "Connecting to target VM..." which never goes away. This is reproducible 100% of the time and I believe it's a recent regression (though I don't remember when it used to work).
I think there is a performance problem at play. Repro steps: 1. Create a new Maven project with a single class: public class Main { public static void main(String[] args) { System.out.println("Success!!"); } } 2. Run Profile Project -> Advanced 3. Notice it takes 5-7 seconds for the Agent to connect. My theory is that for a real-life project, it's really taking over 10 seconds to connect but by then the Agent gives up. Any idea why it's taking so long?
Confirmed. Performance is the problem. I added the "-J-Dprofiler.agent.connect.timeout=60" command-line option and sure enough, 25 seconds after the agent is launched the debugging session begins. Now we need to establish why it's taking a whopping 25 seconds to start the session. I am running on Windows 7, 64-bit, JDK 8 update 5, on a i7 950 CPU with 24GB ram. While the agent is starting up, only 50% of one core is in use so I'm not sure what the bottleneck could be. Time to profile the profiler? :)
please profile the IDE while trying to profile your app and attach the snapshot
Created attachment 147687 [details] .npss file attached from NetBeans .npss file
Thomas, Done. Take a look at the snapshot and let me know what you find.
looks like profiler needs some time until it attaches to the running agent. Please evaluate ...
Is there a way to provide reproducible test case? Thanks.
To investigate this issue we need reproducible test-case. Thanks.
Product Version: NetBeans IDE Dev (Build 201408170001) Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev Repro steps: 1. Open issue244929.zip (will attach in a moment) 2. Click Profile Project icon 3. Select Advanced 4. Click Run 5. 8 seconds elapses and an error dialog pops up "Redefinition failed with error 62". Click "Okay". Testcase will run. The error message seems like a secondary bug. The primary thing to notice is that it takes 8 seconds (from the moment Netbeans prints "Profiler Agent: Waiting for connection") to launch this minimal testcase. Non-trivial projects (consisting of more classes) take slightly longer to load, which pushes them over the 10 second limit.
Created attachment 148770 [details] Testcase
"Redefinition failed with error 62" is caused by JDK bug in JDK 8u11 (issue #245522). Can you please try older version of JDK to see how this example really works. Thanks.
Tomas, The "error 62" problem goes away with JDK 8 update 5 but the original problem remains (attaching the profiler takes too long). Something is running in the beginning which is taking too long. It takes 6-8 seconds for a simple Hello World program and 25 seconds for an application with 150,000 lines of code. I am expecting you to improve this performance and/or come up with a more reasonable way to handle longer timeouts (progress bar with a default timeout that is longer than 10 seconds).
I am not able to reproduce it with latest dev. build with attached test project. It takes under a second from the moment Netbeans prints "Profiler Agent: Waiting for connection" to launch the test application.
Verified as WORKSFORME in build 201506110001.