Optimisation of RAM allocation.