You can learn a lot about your Java™ application by using the hprof profiling agent
Statistics about CPU and memory usage are presented along with many other options. The hprof tool is discussed in detail in Using the HPROF Profiler. -Xrunhprof:help gives you a list of suboptions that you can use with hprof.