Having trouble using both the Java debugger and profiling

Questions about YourKit Java Profiler
Post Reply
Michael.Scaman
Posts: 34
Joined: Mon Feb 02, 2015 3:14 pm

Having trouble using both the Java debugger and profiling

Post by Michael.Scaman »

Is there a known issue in using the eclipse debugger with your kit when you attach the yjp object from startup?

debug flags = "-Djava.security.debug=all" at the same time the shared object is attached
yjp flags = '-agentpath:/var/lib/yjp-2015-eap-build-15026/bin/linux-x86-64/libyjpagent.so=port=10005'

Is there an issue using the above together . When I use the yjp flags I seem to have to turn off the debug.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Having trouble using both the Java debugger and profilin

Post by Anton Katilin »

Hi Michael

We are not aware of debugger and profiler incompatibilities, they should work together just fine.

Could you please describe the problem in more detail.

Do you use the Eclipse's Debug action and specify the profiler's '-agentpath option?

Or do you use Run or Profile actions?

Do you use the standard Java launcher executable "java"?

Also, please use the latest EAP build instead of 15026.

Best regards,
Anton
Michael.Scaman
Posts: 34
Joined: Mon Feb 02, 2015 3:14 pm

Re: Having trouble using both the Java debugger and profilin

Post by Michael.Scaman »

I will try again with the latest build and let you know. Thanks.
bcalmac
Posts: 15
Joined: Tue Apr 29, 2008 6:15 pm

Re: Having trouble using both the Java debugger and profilin

Post by bcalmac »

I'm seeing this when starting Java through the Advanced Installer service launcher (AI 10, Java 7). Then I've accidentally discovered that it works if the debug arg comes first and fails if the yjp arg comes first:

-agentpath:C:\tools\yjp\bin\win64\yjpagent.dll=dir=. -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5000

Code: Select all

[YourKit Java Profiler 2016.02-b34] Log file: C:\Users\bca\.yjp\log\SynapDM.exe-4664.log
ERROR: JDWP unable to get necessary JVMTI capabilities.
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5000 -agentpath:C:\tools\yjp\bin\win64\yjpagent.dll=dir=.

Code: Select all

[YourKit Java Profiler 2016.02-b34] Log file: C:\Users\bca\.yjp\log\SynapDM.exe-2308.log
Listening for transport dt_socket at address: 5000
Note that I cannot reproduce the problem when running a HelloWorld application from the command line or with an application server like JBoss. If anyone runs into this again, try switching the args order, it might work.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Having trouble using both the Java debugger and profilin

Post by Anton Katilin »

Try to specify the agent startup option "withdebugger":
-agentpath:C:\tools\yjp\bin\win64\yjpagent.dll=dir=.,withdebugger
bcalmac
Posts: 15
Joined: Tue Apr 29, 2008 6:15 pm

Re: Having trouble using both the Java debugger and profilin

Post by bcalmac »

Yes. The "withdebugger" option fixes it!
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Having trouble using both the Java debugger and profilin

Post by Anton Katilin »

Thank you for the confirmation.
Post Reply