buffer optimize memory