Part Number: TM4C129ENCZAD
Tool/software: TI-RTOS
I am investigating a memory leak issue with the TIVA microcontroller.
The microcontroller is a TCP server. A client establishes a TCP connection to the microcontroller. While the TCP socket is still engaged, yank out the ethernet cable from the launchpad. At this point, the microcontroller detects the loss of ethernet and attempts to clean up by closing the sockets. However, not all memory is reclaimed and 4112 bytes are lost. The TCP send buffer is 2048 bytes and TCP receive buffer is 2048 bytes as well. So the amount of memory lost is 16 bytes more than the TCP send and receive buffer. Another issue is that when the ethernet cable is plugged in again, I can no longer establish a TCP server on the same port number, I have to use another port number.
I have verified that if the client disconnects from the socket prior to pulling the ethernet cable, there is no memory loss. I have also made sure that I am calling fdclose when the loss of ethernet link is detected as well.
I have recreated the same bug in a small app that runs on the TI Launchpad. Please help. NDKTest.zip








