Correct memory-use calculation