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 252085 - Profiler shows nothing for profile "Objects"
Summary: Profiler shows nothing for profile "Objects"
Status: RESOLVED INVALID
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 8.1
Hardware: PC Windows 8
: P3 normal (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-24 19:57 UTC by Lolmewn
Modified: 2015-04-30 09:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (101.69 KB, text/plain)
2015-04-24 19:57 UTC, Lolmewn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lolmewn 2015-04-24 19:57:52 UTC
Product Version = NetBeans IDE Dev (Build 201504150001)
Operating System = Windows 8 version 6.2 running on amd64
Java; VM; Vendor = 1.8.0_45
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.45-b02

When running the profile after attaching to a locally running java task, there is no data being shown in the "Methods" or "Objects" profiles. 
This makes the profiler useless for looking for memory leaks. 
The other profiles seem to be working just fine.
Comment 1 Lolmewn 2015-04-24 19:57:56 UTC
Created attachment 153382 [details]
IDE log
Comment 2 Tomas Hurka 2015-04-27 14:21:31 UTC
Can you please provide more info? We would like to see exact steps how to reproduce it. What profiler settings do you use? Thanks.
Comment 3 Tomas Hurka 2015-04-27 14:26:44 UTC
According to messages.log there are some modules from 201504150001 daily build and some are installed via plugin manager from 20150322 daily build. Please uninstall 'NetBeans Dev 201504150001' and install latest daily build. Thanks.
Comment 4 Lolmewn 2015-04-27 15:58:05 UTC
Just installed DEV 201504270341 - same problem. I did it via "Profile External Process", where I added -agentpath:C:\Users\Lolmewn\AppData\Roaming\NetBeans\dev\lib\deployed\jdk16\windows-amd64\profilerinterface.dll=C:\Users\Lolmewn\AppData\Roaming\NetBeans\dev\lib,5140 to the startup batch script. After this, profiling works for everything except Objects.
Comment 5 Lolmewn 2015-04-27 16:01:57 UTC
I can, however, perform a heap dump and analyse memory consumption there. Live would be so much better though
Comment 6 Jiri Sedlacek 2015-04-27 16:10:17 UTC
"After this, profiling works for everything except Objects" - does it mean the Methods profiling started to work for you?

We would appreciate if you could describe your steps in more details - are you attaching the profiler to an Already running local Java process or to Manually started local Java process (choices in Attach Settings dialog)? What happens if you click the Attach button?

When configuring the profiler, have you selected to profile All classes or Selected classes (and what choices are selected for this mode)?
Comment 7 Lolmewn 2015-04-27 16:36:02 UTC
(In reply to Jiri Sedlacek from comment #6)
> "After this, profiling works for everything except Objects" - does it mean
> the Methods profiling started to work for you?

Correct. Now I'm actually not sure anymore if this worked with the older netbeans version too... but I think it didn't. 
Regardless, Methods is not useful for me since I want to profile memory allocation (and find leaks). 

> We would appreciate if you could describe your steps in more details - are
> you attaching the profiler to an Already running local Java process or to
> Manually started local Java process (choices in Attach Settings dialog)?
> What happens if you click the Attach button?

I start up the local program via a batch file using the extra arguments provided by Netbeans. The program waits until the profiler attaches - which it does when I press the attach button. The same happens when I attach to the already-running service though, this does not seem to make a difference. 
 
> When configuring the profiler, have you selected to profile All classes or
> Selected classes (and what choices are selected for this mode)?
All classes.
Comment 8 Tomas Hurka 2015-04-27 17:17:30 UTC
(In reply to Lolmewn from comment #5)
> I can, however, perform a heap dump and analyse memory consumption there.
> Live would be so much better though
This definitely works in general case for a lot of people. There must be something specific in your setup. What JDK is used for profiled application? Are there any exceptions in the stdout/stderr in profiled application? Can you try to profile some other application to see if memory profiling works there or not?
Comment 9 Lolmewn 2015-04-27 17:33:15 UTC
(In reply to Tomas Hurka from comment #8)
> (In reply to Lolmewn from comment #5)
> > I can, however, perform a heap dump and analyse memory consumption there.
> > Live would be so much better though
> This definitely works in general case for a lot of people. There must be
> something specific in your setup. What JDK is used for profiled application?
> Are there any exceptions in the stdout/stderr in profiled application? Can
> you try to profile some other application to see if memory profiling works
> there or not?

That was a very good idea. Just profiled a random other project I have which has a main function (the project I want to profile does not since it's a plugin for something called Bukkit) and in that program Objects was actually working. 

I went ahead and tried another external process attach - still no luck. The batch script I use to launch the program is the following: 

> java -Xdebug -Xrunjdwp:transport=dt_socket,address=1002,server=y,suspend=n -jar craftbukkit.jar

Using JDK 1.8.0_45
Comment 10 Lolmewn 2015-04-27 17:40:21 UTC
As for the output: 

> Profiler Agent: JNI OnLoad Initializing...
> Profiler Agent: JNI OnLoad Initialized successfully
> [19:31:48 INFO]: Profiler Agent: Waiting for connection on port 5140 (Protocol version: 16)
> [19:31:48 INFO]: Profiler Agent: Established connection with the tool
> [19:31:48 INFO]: Profiler Agent: Local accelerated session
> Profiler Agent: 250 classes cached.

No errors.
Comment 11 Tomas Hurka 2015-04-28 13:50:48 UTC
(In reply to Lolmewn from comment #9)
> I went ahead and tried another external process attach - still no luck. The
> batch script I use to launch the program is the following: 
> 
> > java -Xdebug -Xrunjdwp:transport=dt_socket,address=1002,server=y,suspend=n -jar craftbukkit.jar

Please run 
java -version
to double check that you are really using JDK 8u45.

If this is OK, run your program with:
java -Dorg.netbeans.lib.profiler.wireprotocol.WireIO=true craftbukkit.jar

and try to attach to it as 'External Process' from NetBeans and use Memory profiling. After that please attach stdout/stderr from craftbukkit.jar and also messages.log from NetBeans - all from the same session. Thanks.
Comment 12 Lolmewn 2015-04-29 15:27:15 UTC
(In reply to Tomas Hurka from comment #11)
> (In reply to Lolmewn from comment #9)
> > I went ahead and tried another external process attach - still no luck. The
> > batch script I use to launch the program is the following: 
> > 
> > > java -Xdebug -Xrunjdwp:transport=dt_socket,address=1002,server=y,suspend=n -jar craftbukkit.jar
> 
> Please run 
> java -version
> to double check that you are really using JDK 8u45.
> 
> If this is OK, run your program with:
> java -Dorg.netbeans.lib.profiler.wireprotocol.WireIO=true craftbukkit.jar
> 
> and try to attach to it as 'External Process' from NetBeans and use Memory
> profiling. After that please attach stdout/stderr from craftbukkit.jar and
> also messages.log from NetBeans - all from the same session. Thanks.

Here's the log from running java -version and from running craftbukkit.jar: http://pastebin.com/M5Dv5aYH

And the messages.log from netbeans: http://pastebin.com/MRE2V5we

I hope this helps. I noticed that the date modified of the netbeans log was 5:04 PM while when I pasted it it was 20 minutes later - I'm not 100% sure if everything is included, but when I closed Netbeans the date didn't change so I assume it's the correct version.
Comment 13 Tomas Hurka 2015-04-30 08:35:29 UTC
(In reply to Lolmewn from comment #12) 
> Here's the log from running java -version and from running craftbukkit.jar:
> http://pastebin.com/M5Dv5aYH
> 
> And the messages.log from netbeans: http://pastebin.com/MRE2V5we
> 
> I hope this helps.
Thanks for the logs (BTW: you can attach them to this issue, there is no need to use pastebin.com). Can you please try to run your application via following command:

C:\Program Files\Java\jdk1.8.0_45\bin\java -Dorg.netbeans.lib.profiler.wireprotocol.WireIO=true -jar craftbukkit.jar

this should fix your problem.
Comment 14 Lolmewn 2015-04-30 09:13:00 UTC
It somehow did... Was I using the JRE version instead of the JDK version or something? I didn't even know that mattered. 
I should probably edit the PATH to point to the JDK in that case instead of JRE, right?