[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Memory leak for timeouts
From: |
Marc CHALAND |
Subject: |
[lwip-devel] Memory leak for timeouts |
Date: |
Tue, 6 Nov 2007 09:55:34 +0100 |
Hello,
We still port lwip to L4. As lwip api msg is synchronous, we decided
to adopt the following architecture :
- one thread for each client process
- one thread per socket
- one thread for each select call.
As a consequence, we have many threads created. By doing some tests,
we've found a memory leak around timeouts. Indeed, sys_timeouts should
provide memory local to each thread. On L4, we use TLS (thread local
storage) : in each thread, if no TLS corresponding to sys_timeouts has
been referenced, a malloc is done and is then referenced into TLS.
But, this little chunk of memory is newer freed.
Today, we decided to fix this by creating a sys_thread_exit function
which free the sys_timeout structure referenced into TLS. Is there
another way we didn't find in lwip ?
Should I propose a patch (sys.h) ? a bug ?
Regards
Marc
- [lwip-devel] Memory leak for timeouts,
Marc CHALAND <=