Reducing memory allocatios during sending messages