Add memory measurement