Ok I am aware of the memory fragmentation after using malloc multiple times and freeing multiple times.
Whats the way around it? I am allocating and deallocating 2K ish memory size for each of my tcp sockets tx and rx buffers. So all up 4k memory for each sockets. After sockets are closed I free the memory. But it seems after about doing a few of these my malloc fails and returns with NULL :(
Is this normal?