Improve memory allocation.