Fully featured low overhead profiler for Java EE and Java SE platforms.
Easy to use performance and memory .NET profiler for Windows and Linux.
Performance monitoring and profiling of Jenkins, Bamboo, TeamCity, Gradle, Maven, Ant and JUnit.

Wrong method invocation count

Moderators: Vladimir Kondratyev, Anton Katilin

Wrong method invocation count

Postby lredor » Tue Aug 31, 2021 9:06 am

Hi,

During some analysis of JUnit tests, I observed a wrong method invocation count. Indeed, if I add a "System.out" in the concerned method, the number of calls is not the same than what is in the Yourkit snapshot.

For example, the analysis is done on ManageBehaviorPCsDeployment a test class from Capella.

The method
Code: Select all
org.polarsys.capella.core.sirius.analysis.CapellaServices.forceRefresh(DDiagram)
is called 2 times. But in Yourkit the method invocation count is "3". As you can see on the below screenshot, there are 2 calls from
Code: Select all
org.eclipse.acceleo.query.runtime.impl.JavaMethodService.internalInvoke(Object[])
, with the line number 162 in the code, and 1 call from the same method but without a line number of code.

Image

Do you have an explanation ?

For information, I use "YourKit Java Profiler 2020.9-b416".

Regards,

Laurent
lredor
 
Posts: 6
Joined: Tue Aug 31, 2021 8:26 am

Re: Wrong method invocation count

Postby lredor » Tue Aug 31, 2021 9:32 am

For information, if I launch the same analysis but just with "Call counting" instead of "Tracing", I have 2 invocation count for
Code: Select all
 org.polarsys.capella.core.sirius.analysis.CapellaServices.forceRefresh(DDiagram)
.
lredor
 
Posts: 6
Joined: Tue Aug 31, 2021 8:26 am

Re: Wrong method invocation count

Postby Anton Katilin » Tue Aug 31, 2021 3:41 pm

Hello Laurent,

Do you see the problem with the latest profiler version 2021.3? The version you're using is no longer supported.

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

Re: Wrong method invocation count

Postby lredor » Wed Sep 01, 2021 7:54 am

Hello Anton,
I've just tried to record a new snapshot with 2021.3 and the problem is exactly the same.
Laurent
lredor
 
Posts: 6
Joined: Tue Aug 31, 2021 8:26 am

Re: Wrong method invocation count

Postby Anton Katilin » Wed Sep 01, 2021 4:49 pm

Hello Laurent,

Could you please provide the problematic snapshot file. You can send a download link to [email protected]

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

Re: Wrong method invocation count

Postby lredor » Thu Sep 09, 2021 3:33 pm

Hello,
I've just sent you the snapshot file through WeTransfer (Capella Perf JUnit tests-2021-09-09-withProblem.snapshot).
I no had longer this snapshot so I recorded it again. And I discovered something because in the first snapshot, I had not the problem. It seems that if I record the snapshot without "Apply filters" checked, I have not the problem. But if I record the snapsot with "Apply filters" checked, I have the problem. I think it's strange but maybe it'll help you in the analysis....
I also sent the snapshot without the problem (Capella Perf JUnit tests-2021-09-09-withoutProblem.snapshot).
Regards,
Laurent
lredor
 
Posts: 6
Joined: Tue Aug 31, 2021 8:26 am

Re: Wrong method invocation count

Postby lredor » Thu Sep 09, 2021 3:45 pm

Here is the my filters list (I don't know if it could help):
Image
lredor
 
Posts: 6
Joined: Tue Aug 31, 2021 8:26 am

Re: Wrong method invocation count

Postby Anton Katilin » Thu Sep 09, 2021 5:56 pm

Hi Laurent,

Thank you for sharing the snapshots. I confirm that we have received and started analyzing them.

It seems that if I record the snapshot without "Apply filters" checked, I have not the problem. But if I record the snapsot with "Apply filters" checked, I have the problem. I think it's strange but maybe it'll help you in the analysis....


It's really strange because the filters are used in the profiler UI only. The profiler agent does not use any of them in runtime. A snapshot should not depend on the filter settings.

We believe there should be another factor affecting the problem reproducibility.

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

Re: Wrong method invocation count

Postby lredor » Fri Sep 10, 2021 7:52 am

Hello Anton,

Here is the result of tests done:
* A- KO : Apply filters checked and "disablestacktelemetry,exceptions=off"
* B- KO : Apply filters unchecked and "disablestacktelemetry,exceptions=off"
* C- OK : Apply filters unchecked and default options (ie stacktelemetry and exceptions activated)
* D- OK : Apply filters checked and default options (ie stacktelemetry and exceptions activated)
* E- KO : Apply filters checked and "disablestacktelemetry" (default for exceptions, ie activated)
* F- KO : Apply filters checked and "exceptions=off" (default for stacktelemetry, ie activated)

These tests confirm that "filters" are not the cause of the problem. But as soon as I disable stacktelemetry or exceptions, the problem occurs.

Laurent

P.S.: I kept the six snapshots if it can help you.
lredor
 
Posts: 6
Joined: Tue Aug 31, 2021 8:26 am

Re: Wrong method invocation count

Postby Anton Katilin » Mon Sep 13, 2021 7:54 am

Hello Laurent,

We answered by email.

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


Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 1 guest

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.