YourKit does not capture cpu/allocation profiler from JNA

Questions about YourKit Java Profiler
Post Reply
test1
Posts: 9
Joined: Tue Aug 23, 2005 5:21 pm

YourKit does not capture cpu/allocation profiler from JNA

Post by test1 »

Hi,

It looks like YourKit does not seem to work properly with JNA. I have some code being called from native code into Java code. All the code running on Java thread works fine. However, code from JNA initiated threads does not show up in either CPU sampling or memory allocation report. Some of that shows up in CPU tracing result though. Is it expected?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: YourKit does not capture cpu/allocation profiler from JN

Post by Anton Katilin »

Hi,

Do you mean https://github.com/twall/jna ?

We are not aware of the problem, perhaps it's on the JNA side. CPU profiling of and object allocation recording in "regular" JNI calls work just fine.

Could you please provide an example of code demonstrating the problem.

Best regards,
Anton
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: YourKit does not capture cpu/allocation profiler from JN

Post by Anton Katilin »

Any update? Or should we close the issue?
test1
Posts: 9
Joined: Tue Aug 23, 2005 5:21 pm

Re: YourKit does not capture cpu/allocation profiler from JN

Post by test1 »

It looks like it only captures the data for the first call. If a native thread is used for callback, it will use do JNI_Attach/JNI_Detach everytime. After JNI_Detach is called, YourKit will not be able to profile that thread anymore. The same thing seems to apply for Java WatchService callback.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: YourKit does not capture cpu/allocation profiler from JN

Post by Anton Katilin »

Could you please provide code example(s) reproducing the problem.
Post Reply