Could not sample the Future<> threads

Questions about YourKit Java Profiler
Post Reply
dreamer
Posts: 3
Joined: Tue May 31, 2016 9:48 pm

Could not sample the Future<> threads

Post by dreamer »

Hi,

Recently, we changed our thread pool implementation using Java 8 Future<>. However, after that the Yourkit could not show the active class/method using in the Future<> thread. It always showed that the main thread was waiting. In contrast, the visualvm showed the correct result, however, it is harder to configure on the remote server. Could you guys give us some solution about this issue? Thank you!
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Could not sample the Future<> threads

Post by Anton Katilin »

Hi,

Could you please provide more detail on the problem: the snapshot file demonstrating it, screenshots of YourKit vs visualvm, etc. If you cannot share them in the forum could you please email them to [email protected]

Best regards,
Anton
dreamer
Posts: 3
Joined: Tue May 31, 2016 9:48 pm

Re: Could not sample the Future<> threads

Post by dreamer »

I tried to mimic the similar logic by using the java lambda and future, it works OK. So I think it's should not the problem of what I said earlier.

I shared the snapshot log here : https://drive.google.com/open?id=0B423M ... WhraVF3eGc

The symptom is that under "hot spots" it only shows the 'java.lang.Thread.run()' took 99% time without internal functions.
Most of the work was running in the "finished threads", I can see some of the functions were listed there if I moved to the green part. Any insight what could be the problem? Thanks.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Could not sample the Future<> threads

Post by Anton Katilin »

Hi,

Thank you for sharing the snapshot.
The symptom is that under "hot spots" it only shows the 'java.lang.Thread.run()' took 99% time without internal functions.
The default filters filter out too much in your case:
https://www.yourkit.com/docs/java/help/filters.jsp
Please turn the filters off, e.g. with "Settings | Apply Filters".
Most of the work was running in the "finished threads"
Please see the startup option "deadthreadlimit":
https://www.yourkit.com/docs/java/help/ ... ptions.jsp
I can see some of the functions were listed there if I moved to the green part.
Sorry, I don't understand. Could you please clarify what you mean with "the green part".

Best regards,
Anton
dreamer
Posts: 3
Joined: Tue May 31, 2016 9:48 pm

Re: Could not sample the Future<> threads

Post by dreamer »

Aha, it is the filter that caused the problem!
Our project became the apache project recently. And the default filter out all apache.org activities. Now everything comes back! Thank you!
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Could not sample the Future<> threads

Post by Anton Katilin »

Thank you for notifying us that the problem is solved.
Post Reply