Measuring actual memory and CPU consumption