Other Parts Discussed in Thread: CC3220SF, CC3200
Tool/software: Code Composer Studio
Hi team,
a customer has the following question:
"I ran the example TCP-Echo from TI in the variant TI Toolchain + TI-RTOS in the debugger.
In this example, a new thread is started for each accepted client request, in which the communication with the respective client then takes place.
According to the program code, the thread terminates if the recv returns an error or 0.
In my test, I started a client, aborted it with CTRL-C, restarted it and so on. Only one client was active at a time.
Client program:
- TI PythonScript
- Call:
python tcpSendReceive.py 192.168.178.30 1000 test -s1000 -n10
- Termination CTRL-C
Already the third connection attempt failed here. The module was then no longer in the network (the router lists the WiFi subscribers).
The RunTime Object Viewer also shows the actually finished threads. These had priority 3, now -1 and still occupy memory/ stack. This inevitably means that with an increasing number of clients and/or logins the system runs out of memory.
If more threads are created, then their stack pointer is always higher than that of the previous, already completed process.
Is it possible to free this "dead" RAM area again? Or is the stack memory of the finished threads "free" for the system and is it provided on demand?
Hence my question: How do I get the finished threads from the system?
A pthread_exit at the end of the tcpWorker thread does not help."
Thank you,
Franz
