Memory pooling part 2 and other optimisations