Optimizing decode memory usage