Hi :
For netconn API, the following netbuf_delete api will free inbuf memory without
delay ?
http_server_netconn_serve(struct netconn *conn)
{
struct netbuf *inbuf;
err_t err;
err = netconn_recv(conn, &inbuf);
if (err != ERR_OK) return;
netconn_write(conn, http_html_hdr, sizeof(http_html_hdr)-1, NETCONN_NOCOPY);
netconn_write(conn, http_index_html, sizeof(http_index_html)-1,
NETCONN_NOCOPY);
netconn_close(conn);
netbuf_delete(inbuf);
}
From: [email protected]
[mailto:[email protected]] On Behalf Of
Vincent Cui
Sent: 2014年8月23日 11:44
To: Mailing list for lwIP users
Subject: Re: [lwip-users] demo web refresh down
Hi
By check
http://www.lpcware.com/content/faq/malloc-failure-using-freertos-heap3c-lpcxpresso-tool-chain
I found that heap is real overfollow once more request coming in frequency.
More memory is not free on time.
In real application, FreeRTOS and LWIP also use C lib malloc and free function
in case of
1. Freertos use heap3.c
2. popt.h define
#define MEM_LIBC_MALLOC 1
#define MEMP_MEM_MALLOC 1
How to fix the issue of heap overflow ?
Vincent
Vincent Cui
Firmware Engineer Leader
[cid:[email protected]]
Room1106, Building A, New Caohejing Business Centre, No.391, Guiping Road,
Xuhui District, Shanghai, P.R.China
T: +86 21 34612525, M: +86 13482482211
www.enlogic.com<http://www.enlogic.com>
________________________________
P please consider the environment before printing this email
________________________________
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to which they are addressed. If
you have received this e-mail in error, please notify the sender immediately
and then delete it. If you are not the intended recipient, you must not use,
disclose or distribute this e-mail without the author's prior permission. We
have taken precautions to minimize the risk of transmitting software viruses,
but we advise you to carry out your own virus checks on any attachment to this
message. We cannot accept liability for any loss or damage caused by software
viruses. Any views and/or opinions expressed in this e-mail are of the author
only and do not necessarily represent the views of Enlogic.
________________________________
From: Vincent Cui
Sent: 2014年8月23日 10:46
To: Vincent Cui; 'Mailing list for lwIP users'
Subject: RE: demo web refresh down
Hi:
I define following to use system malloc and free
#define MEM_LIBC_MALLOC 1
#define MEMP_MEM_MALLOC 1
I found that the malloc memory is not free on time, so malloc failure in new
request coming.
It seems to need some protect those . Am I right ?
Vincent
From: Vincent Cui
Sent: 2014年8月23日 9:50
To: [email protected]<mailto:[email protected]>
Subject: demo web refresh down
All:
I use LPCXPRESSO to develop a simple demo server with NETCONN api on LPC1769
If the demo server refresh itself per 3 second, it works well.
If I refresh it by press F5 frequencely, it halt and can’t connect to host..
Who know the reason ?
Vincent
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users