I allocate a big memory pool from RTOS (I already know my application memory requirement, it will not grow beyond a certain size). And then my application allocation requests are fulfilled from that pool.
Recently I started facing a problem; allocation request were not being fulfilled even though memory was there (got integrated memory bench marking framework, which showed this), investigation reveals we are suffering from memory fragmentation.
My application is heavily dependent on STL (also receive data from network, XML parsing, image manipulation, saving it as PNG etc), and as heap memory allocation behind memory fragmentation (are there any other reasons?), What are best ways to avoid it?