Fixed memory detection in benchmarks.