Memory measurement fix