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

markusklemt at gmx.de markusklemt at gmx.de
Mon Nov 28 21:44:23 CET 2005


Hi,

I thanks all for the answers, now I use global variables.

It works, but I think malloc and free are the better solution.

Markus

-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Ernst Stippl
Gesendet: Sonntag, 27. November 2005 21:49
An: 'Ethernut User Chat (English)'
Betreff: AW: [En-Nut-Discussion] Problems with heap Memory


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

_______________________________________________
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