Improved memory allocation for a simulation.