giovedì 6 settembre 2012

Notes about presentation Performance Tuning by Kirk Pepperdine

In case of performance troubles :
- don't start with code inspection.
- start with Execution profiling instead (may help to find out code bugs)
- add GC debuggin/loggins options or take a look to JMX GCBeans
Correct performance tuning process
1 Set a baseline
2 Modify only one thing a time
3 Make performane test / create new baseline
4 Restart the process again if performance doesnt increase significantly

Basic things to watch at
cpu utilization (don't waste cpu cycles)
application  OS interactions
network io
disk io

Performance monitoring TOOLS TO START with 
System monitoring tools (info about CPU, server Memory used , Network IO, Disk IO
Memory monitoring tools
JVM monitoring tools (garbage collection, memory usage, threads)
Free sample tool visual vm for JMV 
Memory leaks analysis
thread monitoring (starving threads, blocked threads )
thead dump (shows blocked threads and running code )
Different memory areas usage (Survivor space bigger / hidden space)

java performance tuning by  charlie hunt 

Other Presentations
(Also available in you tube at )

Mailing list

mercoledì 5 settembre 2012

VarArgs method samples

package test;
 * @author Paolo
public class VarArgsTest {

 public static void method1VarArgs(int ...intsArray){
  System.out.println("length ="  + intsArray.length);


 public static void method2VarArgs(String ...stringsArray){
  System.out.println("length ="  + stringsArray.length);

  * @param args
 public static void main(String[] args) {
  method2VarArgs("a", "b");

And output is :

length =0
length =3
length =0
length =2

NOTES: Arrays  are never null (neither if method is called without any parameter )