lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Problem with memory management


From: Walter Saegesser
Subject: [lwip-users] Problem with memory management
Date: Fri, 3 Feb 2012 10:00:05 +0000

I encounter a severe problem with the memory manager (mem.c, MEM_USE_POOLS not set, LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT not set).

My buffer is approx 40kB. An SSL connection to a server on the internet does a big amount of allocations/deallocations (mostly small blocks). For receiving data from the server I need 1kB blocks.

It all works fine until all of a sudden the manager is no longer able to get a 1kB block and the ‘err’ counter of the mem-stats is counted up (every 100ms for about 15s until the system is reset by the watchdog).

 

In the debugger I have a real-time monitoring of the used ram (lwip_stats.mem.used). The value goes up and down, as expected, definitively no accumulation. The high-water-mark is at least 10kB below the heap size.

The system is multitasking. The task trying to get the 1kB block sleeps for a while if it fails, thus enabling other tasks to run and possibly free memory. However, the error is not recoverable and the system crashes.

If the systems runs into this situation (one task trying in vain to get a 1kB block), you can see the ‘used’ value go down to about 22kB, i.e. almost 18kB are free.

 

The problem arises always at almost the same amount of data received from the server, so I think it’s a systematic problem and not just accidental.

Could this be a bug or what else could be wrong?

 

Thanks and regards,

Walter

 

 

_______________________________________________
Walter Saegesser
Dipl.-Ing. (FH)

R&D - Software
Business Unit IMS – Line of Business Solar Inverter
_______________________________________________
Delta Renewable Energy Systems (Switzerland) AG
Burgerfeldstrasse 19, CH-8730 Uznach SG, Switzerland
TEL:       +41 (0)55 61 66 107
FAX:       +41 (0)55 61 66 111
address@hidden
www.deltaenergysystems.com
_______________________________________________

 

********************************************************************************************************************************
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain
confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
[Delta Energy Systems]
********************************************************************************************************************************

reply via email to

[Prev in Thread] Current Thread [Next in Thread]