mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
samples: net: civetweb: reduce RAM usage
adjust configuration so that civetweb uses less memory fixes #21179 Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
This commit is contained in:
committed by
Jukka Rissanen
parent
06b44b12c7
commit
c28ffbb2eb
@@ -13,12 +13,12 @@ CONFIG_NET_IPV4=y
|
||||
# CONFIG_NET_IPV6 is not set
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_NET_SOCKETS=y
|
||||
CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=131072
|
||||
CONFIG_NET_TX_STACK_SIZE=8192
|
||||
CONFIG_NET_RX_STACK_SIZE=8192
|
||||
CONFIG_ISR_STACK_SIZE=8192
|
||||
CONFIG_MAIN_STACK_SIZE=8192
|
||||
CONFIG_IDLE_STACK_SIZE=2048
|
||||
CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=16384
|
||||
CONFIG_NET_TX_STACK_SIZE=2048
|
||||
CONFIG_NET_RX_STACK_SIZE=2048
|
||||
CONFIG_ISR_STACK_SIZE=2048
|
||||
CONFIG_MAIN_STACK_SIZE=2048
|
||||
CONFIG_IDLE_STACK_SIZE=1024
|
||||
|
||||
CONFIG_DNS_RESOLVER=y
|
||||
|
||||
|
||||
@@ -10,7 +10,13 @@
|
||||
|
||||
#include "civetweb.h"
|
||||
|
||||
#define CIVETWEB_MAIN_THREAD_STACK_SIZE 4096
|
||||
#define HTTP_PORT 8080
|
||||
#define HTTPS_PORT 4443
|
||||
|
||||
#define CIVETWEB_MAIN_THREAD_STACK_SIZE CONFIG_MAIN_STACK_SIZE
|
||||
|
||||
/* Use samllest possible value of 1024 (see the line 18619 of civetweb.c) */
|
||||
#define MAX_REQUEST_SIZE_BYTES 1024
|
||||
|
||||
K_THREAD_STACK_DEFINE(civetweb_stack, CIVETWEB_MAIN_THREAD_STACK_SIZE);
|
||||
|
||||
@@ -139,12 +145,12 @@ void *main_pthread(void *arg)
|
||||
{
|
||||
static const char * const options[] = {
|
||||
"listening_ports",
|
||||
"8080",
|
||||
STRINGIFY(HTTP_PORT),
|
||||
"num_threads",
|
||||
"1",
|
||||
"max_request_size",
|
||||
"2048",
|
||||
0
|
||||
STRINGIFY(MAX_REQUEST_SIZE_BYTES),
|
||||
NULL
|
||||
};
|
||||
|
||||
struct mg_callbacks callbacks;
|
||||
|
||||
Reference in New Issue
Block a user