Add both memory and CPU cost.