Monitors the CPU and memory usage for a PID.