If you are using Java from Sun and you use at least Java 6 update 10 (i.e. the newest), then try running jvisualvm from the JDK on the same machine as your program is running, and attach to it and enable profiling.
This is most likely the simplest way to get started.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…