optional max memory usage