AW: [En-Nut-Discussion] Problems with heap Memory

Ernst Stippl ernst at stippl.org
Sun Nov 27 21:49:26 CET 2005


Hi Markus!

For each use of "NutTcpCreateSocket" and the following "NutTcpAccept" (which
does the listen) you need to do an "NutTcpCloseSocket". Otherwise the memory
for the various net buffers will not be free'd.  
Are you sure your program logic is OK? Try eliminate all processing between
the "NutTcpCreateSocket"/"NutTcpAccept" and the "NutTcpCloseSocket" (make
sure you can really see if it is processed) and see if the problem persists.

malloc and free are easy:

ptr = malloc (size);           returns the ptr to the memory region of the
requested size
free (ptr);                    frees the memory region pointed to by ptr

regards
ernst
-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von
markusklemt at gmx.de
Gesendet: Samstag, 26. November 2005 12:49
An: Ethernut User Chat (English)
Betreff: [En-Nut-Discussion] Problems with heap Memory

Hi,

I use ethernut os/net for or project in my studies.

My ethernut listen at a TCP/IP Port, if I open a html page a java applet
connects to the listen port.

If I close the html page the java applet disconnects with the ethernut. But
the used  memory is not free.

If the java applet connects and disconnects again, the memory goes smaller
and smaller.

I want to use malloc() and free(), but I don't know how to use.


Sorry for my bad English.

Markus

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list