lwIP - A Lightweight TCP/IP stack - Bugs: bug #60758, Provide a way to release all memory
You are not allowed to post comments on this tracker with your current authentication level.
bug #60758: Provide a way to release all memory
Submitter: | R. Diez <rdiez> | ||
Submitted: | Wed 09 Jun 2021 06:55:04 PM UTC | ||
Category: | None | Severity: | 3 - Normal |
Item Group: | Feature Request | Status: | None |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Open | Planned Release: | None |
lwIP version: | git head |
Thu 10 Jun 2021 08:22:51 AM UTC, comment #2: |
R. Diez <rdiez> |
Thu 10 Jun 2021 06:46:42 AM UTC, comment #1: No, callign al timeout handlers will definitively not be enough. As long as you don't know exactly how this one would be easier as bug #55598 (clean shutdown), could we please close this as duplicate? We have too many bugs open here, and this one isn't even a bug. It would be better off in the "tasks" section. |
Simon Goldschmidt <goldsimon> |
Wed 09 Jun 2021 06:55:04 PM UTC, original submission:
I recently asked the following question in the lwip-users mailing list:
|
R. Diez <rdiez> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Powered by Savane 3.13-02a9.
Corresponding source code
Could you elaborate more?
I do not know much about lwIP's internals, so I can only describe the naive train of thought: if I remove all network interfaces and make everything time-out (perhaps by artificially moving the current time far into the future), wouldn't all connections and PCBs (listening or not) be automatically destroyed? What resources would remain then?
That information will probably be useful not just for future implementers: if I know what to expect, I could code an exception, so that those memory blocks are skipped from the final memory leak report.
I cannot know that 'exactly', because I am not familiar lwIP's internals.
The "clean shutdown" bug talks about being able to restart. Normally, that is harder to achieve than providing a termination routine.
Such a routine could just release all malloc() memory and not bother to reset everything for an eventual restart. The documentation could state that lwIP is afterwards not stable, so that calling any other lwIP function is likely to crash.
But if you know better, you can close this bug yourself.
There is one more aspect: one could implement clean termination and restart, and still not release all memory. For example, the restarted lwIP could re-use some old memory pools that are still hanging around.
I do not know what "tasks" section you are talking about, but yes, I gather that you could move it there and close this feature request as "moved to the tasks section".