monitor the resource usage of processes,inspired by iotop's implementention