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:
ps -e | grep java", pass it to
pmap, as in "
pmap -x 6598", and look for total KB entry in the Private column
As well, the JDK itself comes with basic profiling tools. For example:
java -Xprof MyClass
java -Xrunhprof:[options] MyClass
vmstatfor Unix hosts, and
perfmonfor Windows hosts.