Measure application performance

Measure your application's size in memory and its execution speed.

Measuring performance throughout construction can help to identify major performance problems as quickly as possible, which is almost always beneficial. If a major problem becomes apparent, then some immediate redesign will likely be necessary. If no major problem is apparent, then, if needed, minor optimizations can be performed later, when construction is nearly complete. (Many would argue that worrying about minor optimizations during construction is not advisable, since optimizations can sometimes make code more obscure.)

These monitoring tools come with the JDK:

If the above tools aren't available, then you are stuck with more primitive means of measuring an application's size in memory. They depend on your platform. For example:

As well, the JDK itself comes with basic profiling tools. For example:

Other tools include vmstat for Unix hosts, and perfmon for Windows hosts.

See Also :
Get size of object in memory
Time execution speed
Measure web app performance