13.12.11

Let Your Applications Talk to You | Javalobby

Let Your Applications Talk to You | Javalobby

Plumbr | We find your memory leaks!
Amdahl's law - Wikipedia, the free encyclopedia

Every developer tries to solve them differently.
  • Some begin with vmstat or top, 
  • others with a CPU profiler 
  • or a DB load monitoring tool. 
  • Many of them turn to different APM products, like 
    • CA APM, 
    • AppDynamics, 
    • dynaTrace, etc.
And you can get the info without relying on indirect metrics of the operating system or the JVM.

You should take into account 2 things:
  1. When method1 calls method2, which calls method3, which in turn calls method4, then the cumulative total time formethod1 in the table above will contain cumulative times for method2, method3 and method4. So the winner of the chart is not always the method that calls for optimization. But, as a rule of thumb, the top10 will almost always be the right place to look.
  2. Optimize one thing at a time, and after every change re-run your application and gather usage data again. Changing runtime characteristics of one method can change the whole TOP list.
Our preferable way to gather such data is to augment every method in the application with a stop-watch. Just measure the method call time and return time and log the difference alongside with the method name. Such monitoring code can be inserted into the application using different ways: bytecode manipulation, AOP frameworks like Spring AOP or AspectJ, or a manual dynamic proxy.

No comments: