Profiles memory usage.