How can get memory and CPU usage of hadoop yarn application?
Yes, you can very well check the total memory and cpu usage of the application.
You may use the Job tracker UI, click on the counters link on the completed page, and might get a typical view as follows. The memory and cpu counters were highlighted.
Clicking on the highlighted links will show you the consumption by every Tasks (Map/Reduce) of the job.
To view these values of these consumption counters from command line, you may use
hadoop job -counter <job-id> org.apache.hadoop.mapreduce.TaskCounter CPU_MILLISECONDS
for cpu usage
hadoop job -counter <job-id> org.apache.hadoop.mapreduce.TaskCounter PHYSICAL_MEMORY_BYTES
for memory usage