Optimizing memory management for better physprot performance