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.

Bug 255666 - No data collected from short lived application
Summary: No data collected from short lived application
Status: REOPENED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-02 22:31 UTC by everflux
Modified: 2016-02-07 14:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (11.20 KB, application/x-compressed-tar)
2015-10-02 22:34 UTC, everflux
Details
screencast showing the problem (1.61 MB, video/webm)
2015-10-05 13:17 UTC, everflux
Details
screencast, clean userdir, showing problem (<2 min) (4.58 MB, video/webm)
2015-10-06 12:16 UTC, everflux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description everflux 2015-10-02 22:31:35 UTC
Product Version: NetBeans IDE Dev (Build 201510020002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Linux version 3.19.0-28-generic running on amd64; UTF-8; en_US (nb)
User directory: /home/tkruse/.netbeans/dev
Cache directory: /home/tkruse/.cache/netbeans/dev

I have a maven based java project with multiple classes with main methods, the classes contain other classes or interfaces.

The profiler does not collect data reliably.

It seems related to a combination of
- selected main class for the project
- whether classes are explicitly configured to be profiled
Comment 1 everflux 2015-10-02 22:34:45 UTC
Created attachment 156492 [details]
sample project
Comment 2 everflux 2015-10-02 22:41:36 UTC
Steps to reproduce
- open sample project
- clock on profile button in toolbar -> profiler window opens
- click on profile button below toolbar in profiler window -> netbeans asks which main class to run
- select one, run it

If data is shown (I can not recall if that worked on the first run for me) select the other class in the project explorer, right click, "profile class", click on profile button in profiler window -> class is executed, no data shown.

If this works for you, open one of the sample classes, place cursor on class name, right click and from context menu "profile..." select "class".
Now run the profiler -> data is shown.

Select other class from project explorer. right click, "profile file" and execute the profiler -> no data shown (expected), select the settings/gears icon in the profiler window (most right in the window mini toolbar), change "selected classes" to "all classes" or "project classes", run profiling session -> no data shown. Change to "project classes", execute profiler session -> no data shown.
Comment 3 Jiri Sedlacek 2015-10-05 12:52:00 UTC
Works fine on my side.

Please note that Profile Class just sets up the profiler to profile code of that class, it doesn't change the project main class. To me it looks like you've set up the profiler to profile class A but the project is actually configured to run class B.

Once you make sure that the project runs the class selected for profiling (Project Properties | Run | Main Class), you'll start getting the data.
Comment 4 everflux 2015-10-05 13:13:52 UTC
Exact reproduction steps with


Product Version: NetBeans IDE Dev (Build 201510050002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Linux version 3.19.0-30-generic running on amd64; UTF-8; en_US (nb)
User directory: /home/tkruse/.netbeans/dev
Cache directory: /home/tkruse/.cache/netbeans/dev


* open project
* select profile project, use Trampoline2Demo as main class
* initial calibration is performed
* data is shown, great
* open Trampoline2Demo
* Right click on Trampoline2Demo, Profile, "Profile class"
* run profiler -> data is shown, great
* Use settings to go back to "all classes"
* Run profile -> no data
Comment 5 everflux 2015-10-05 13:17:26 UTC
Created attachment 156517 [details]
screencast showing the problem
Comment 6 everflux 2015-10-05 13:32:41 UTC
On second though I added Thread.sleep - then I get data collected again with all classes.
I assume that the sampler does not get results since the sample project is too small.

This does not explain why it consistently worked at first and only broke when I first selected the 'profile class' mode and switched back.

If this is indeed the root cause, I would expect from a user perspective to have an alert box like 'no data was collected in sampling mode, try instrumented mode or choose an application that runs longer' instead of netbeans hanging there with the output window of the maven build.
Comment 7 Tomas Hurka 2015-10-06 10:35:21 UTC
I am sorry, but I am not able to reproduce it. Did you start with clean userdir? Did you write all the steps?
Comment 8 everflux 2015-10-06 10:38:13 UTC
Which step can you not reproduce?

I tried it on two machines, one had a clean userdir, the other not.
Both machines intel, one 2 cores plus hyperthreading, the other 8 cores plus hyperthreading.
Both latest Java 8u60 and latest Netbeans nightly with the new profiler.
Comment 9 Tomas Hurka 2015-10-06 11:46:07 UTC
(In reply to everflux from comment #8)
> Which step can you not reproduce?
I am following those steps in 'comment 4' and it works for me.
Comment 10 everflux 2015-10-06 11:48:21 UTC
If you cross check it with the video attachment I added, you can confirm that you get data in the last step?
That would mean that there is actually a bug and I did not have false assumptions about how to use the profiler. (sampling mode of too short application)
Comment 11 Tomas Hurka 2015-10-06 11:50:06 UTC
(In reply to everflux from comment #10)
> If you cross check it with the video attachment I added, you can confirm
> that you get data in the last step?
Yes, I do get the data.
Comment 12 everflux 2015-10-06 11:53:35 UTC
What can I do to complete the bug report?
Comment 13 Tomas Hurka 2015-10-06 12:04:52 UTC
(In reply to everflux from comment #12)
> What can I do to complete the bug report?
Please start with clean userdir and document all the steps. If this is not possible, provide full video, so we can extract the steps to reproduce this issue ourself.
Comment 14 everflux 2015-10-06 12:16:25 UTC
Created attachment 156556 [details]
screencast, clean userdir, showing problem (<2 min)
Comment 15 everflux 2015-10-06 12:17:32 UTC
steps:

- profile project (works)
- profile single class (works)
- switch back to profile all classes / project classes (no data)
Comment 16 Tomas Hurka 2015-10-06 13:19:08 UTC
(In reply to everflux from comment #14)
> Created attachment 156556 [details]
> screencast, clean userdir, showing problem (<2 min)
Thanks for the screencast. The missing part in your steps is the following item:
Click on 'Do not show this messages again' checkbox in 'The profiled application has finished execution.'

Next time, it would be great if you can provide exact steps and do not leave out some of them - even if they look unimportant.
Comment 17 everflux 2015-10-06 13:23:14 UTC
Oh my... I wasn't even aware of that click, otherwise I would have included it. Sorry that I made this bug report such a bad experience.

Thanks for taking it seriously and looking into it!
If I can provide any additional help/information let me know.
Comment 18 Tomas Hurka 2015-10-06 14:08:40 UTC
To workaround this issue, you can reset 'Do not show again' confirmations in Profiler preferences (Options/Java/Profiler/General). This way you will get the dialog back. The confirmation dialog will keep profiler application live longer so that profiler will get profiled data.
Comment 19 Tomas Hurka 2015-10-06 14:13:48 UTC
(In reply to everflux from comment #17)
> Oh my... I wasn't even aware of that click, otherwise I would have included
> it. Sorry that I made this bug report such a bad experience.
> 
> Thanks for taking it seriously and looking into it!
> If I can provide any additional help/information let me know.
Thanks, I think we have all the information to reproduce the problem.