Measuring memory and CPU usage

At times we need to measure performance and nothing better than monitoring it in field. SInce it can cause resource usage to go up, usually in field monitoring has to be done mindfully. These two article below are quite useful, while they are android focussed, non-java versions are useful for general Linux systems as well