espressif / idf-extra-components

Additional components for ESP-IDF, maintained by Espressif
147 stars 89 forks source link

coap: Add in OSCORE support into the examples (IEC-59) #250

Closed mrdeep1 closed 10 months ago

mrdeep1 commented 11 months ago

Checklist

Change description

Add in configurable OSCORE support. Support building when only IPv4 is available. Update to latest libcoap code (4.3.4).

hmalpani commented 11 months ago

Hello @mrdeep1 I have done some memory analysis on this PR.

Example Version Size (libcoap.a) Peak Heap Usage
coap_client after update 51377 30488
coap_client before update 50519 29820
coap_server after update 60278 Peak heap usage increases after every request
coap_server before update 60036 Peak heap usage increases after every request

I suspect coap_server is leaking memory on every request from a client. Can you please check?

mrdeep1 commented 11 months ago

I suspect coap_server is leaking memory on every request from a client. Can you please check?

I have pushed a change to the coap server to include coap_context_set_max_idle_sessions(ctx, 20); which limits the number of idle server sessions to 20.

So now, for the first 20 requests from different (source_ip, source port} requests I would expect to see heap usage increasing, but not after that.