I'm using JMC tool with JFR to do profiling on Java application.
After doing a record, and loading the JFR file, when i go to "Method Profiling", i saw Top package and top class and stack trace associated. In stack trace saw number of metod's call but i don't see time elapsed in a method.
Could you tell me what to do to see time elapsed for profiling methodsee image
The way JFR collects data is by sampling thread stacks, so there is no information in a recording on how long time a method has executed. The reason JFR uses sampling is to keep the overhead low and not skew the result by adding instrumentation to the application.
Related
I started to monitor JMeter with script running with e.g. Jconsole and noted number of classes goes up gradually then quickly down, then gradually up again.
Is it typical behaviour of JMeter? Maybe even JVM in general? Or particular plug-in code should be involved? I'm concerned that to decrease number of classes GC is run and that can affect continuity of generated load. I was not able to find the answer via web search now.
ADDED: Test plan includes making HTTP request samplers, JSON Assertions, using concurrency thread group to increase load in steps + randomization (Random Controller, Random Variable Config Element).
ADDED 2:
Following advice by Dmitri, I run test JVM_ARGS="-Xlog:class+unload -Xlog:class+load"; jmeter ... for about 60 min (3600 sec test) I got around 116 000 classes loaded and 68 000 classes unloaded, below shows all unloaded classes with times unloaded (jdk.nashorn.internal.scripts.Script take most of occurrences and mean time confirm it happened sometime during the test - being technically correct not only at start or only at finish) (from Jupiter notebook):
time
size mean
classname
java.lang.invoke.LambdaForm 978.0 29.757680
jdk.nashorn.internal.runtime.Context 11.0 17.486000
jdk.nashorn.internal.scripts.ModuleGraphManipulator 305.0 17.489377
jdk.nashorn.internal.scripts.Script 66845.0 2308.991561
Any additional advice? What to look for further?
I would say this is due to some randomization as other mentioned test elements are unlikely to cause increase in the number of loaded classes and trigger unloading.
This is normal behavior of the JVM which can unload the classes if/when they are no longer referenced by the program.
You can add the following JVM options to your JMeter startup command:
-XX:+TraceClassLoading -XX:+TraceClassUnloading
so you will be able to see which exact classes are being loaded/unloaded at the given moment of time.
Unfortunately it is not possible to provide more information without seeing your test plan and JVM arguments, just ensure that you're following recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article to get confidence that your test will not crash due to a memory leak as JMeter gives enough freedom of shooting your own leg.
I am currently trying to improve the performance of my Asp.Net Application. During this I have found out that when I call the same action multiple time or different action within the same controller through ajax call, it takes the unequal amount of time. Please refer below image.
Timeline of request
On digging using Dot trace tool, I found that this difference is being traced as "Waiting for CPU" i.e. task is waiting for thread assignment. How can we optimize this so that all the same actions get equal amount of time to execute their functionality.
Your CPU is at his max capacity. Close unused program to freed some CPU activity
I am trying to measure time for next button one page to another. To do this I start transaction before to press button, I press the next button , when the next page loaded I end the transaction. Between this transaction process I use web_reg_find() and check specific text to verify that page.
When I use controller that transaction measured 5 sec , then I modified transaction content and delete web_reg_find() after I measured that transaction it will be 3 sec. Is that normal ?
Because I do load test , functionality is important so transaction are also important. Is there any alternative way to check content and save the performance ?
web_reg_find() does some logic based on the response sent from the server and therefore takes time. LoadRunner is aware that this is not actual time that will be perceived by the real user and therefore reports it as "wasted time" for the transaction. If you check the log for this transaction you will see something like this:
Notify: Transaction "login" ended with "Pass" status (Duration: 4.6360 Wasted Time: 0.0062).
The time the transaction took and out of that time how much time was wasted on LoadRunner internal operations.
Note that when you will open the result in Analysis the transaction times will be reported without the wasted time (i.e. Analysis will report the time as it is perceived by the real user).
The amount of time taken for the processing of web_reg_find() also seems unusually long. As web_reg_find() is both memory and CPU bound (holding the page in ram and running string comparisons) I would look at other possibilities as to why it takes an additional two seconds. My hypothesis is that you have a resource constricted, or over subscribed load generator. Look at the performance of a control group for this type of user, 1 user loaded by itself on a load generator. Compare your control group to the behavior of the global group. If you see a deviation then this is due to a local resource constriction which is showing as slowed virtual users. This would have an impact on your measurement of response time as well.
I deliberately underload my load generators to avoid any possibility of load generator coloration plus employing a control generator in the group to measure any possible coloration.
the time which is taken by web_reg_find is calculated as waste time...
I have a process that crashes unexpectedly.
About the same time the crash occurs, I see an error in the log infrastructure process and then it softly shut down.
I'm trying to understand which of the processes is causing the problem, the log infra getting my process crash or the other way around.
In order to do that, I'm looking at the crash dump my process produced (taken with adplus) and trying to understand, at what time exactly the first exit-related method was called, then compare it with the log infra error time and shutdown time.
How can I do that, is there a way to get, method calls time stamp, in stack?
Thanks.
Attach WinDbg or start your app with WinDbg and change the show time stamps parameter:
.echotimestamps 1
This will insert timestamps into the output for all events such as exceptions, thread creations etc.. see this msdn link.
I would also write a log to disk immediately once WinDbg attaches:
.logopen c:\temp\mylog.txt
to capture the output, this should achieve what you want.
I am profiling a web application with jvisualvm. I can see how long various methods takes for example methodA takes 5 seconds... However, I can't see to double click this method to see where the 5 seconds is going. I can "drill down" so to speak.
How do I achieve this in jvisualvm?
Thanks.
If you hit the 'Snapshot' button in the Sampler or Profiler windows after profiling CPU usage, it will show you a call tree with a summary of the CPU time for each method, along with self-times.