Memory usage optimize