Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: README.md
- Revision:
- 19:a5371b71de6f
- Parent:
- 12:530c2ebee349
- Child:
- 22:71fc1b1894f8
diff -r f7a85895a941 -r a5371b71de6f README.md --- a/README.md Mon Sep 04 16:31:38 2017 +0100 +++ b/README.md Mon Sep 04 16:52:46 2017 +0100 @@ -41,7 +41,18 @@ delete request; ``` -## Dealing with large body +## Memory usage + +Small requests where the body of the response is cached by the library (like the one found in main-http.cpp), require ~4K of RAM. When the request is finished they require ~1.5K of RAM, depending on the size of the response. This applies both to HTTP and HTTPS. If you need to handle requests that return a large response body, see 'Dealing with large body'. + +HTTPS requires additional memory. On FRDM-K64F: + +* TLS handshake requires 53K of heap space. +* Keeping TLS socket open requires 43K of heap space. + +This means that you cannot use HTTPS on devices with less than 128K of memory, as you also need to reserve memory for the stack and network interface. + +### Dealing with large body By default the library will store the full request body on the heap. This works well for small responses, but you'll run out of memory when receiving a large response body. To mitigate this you can pass in a callback as the last argument to the request constructor. This callback will be called whenever a chunk of the body is received. You can set the request chunk size in the `HTTP_RECEIVE_BUFFER_SIZE` macro (see `mbed_lib.json` for the definition) although it also depends on the buffer size of the underlying network connection. @@ -91,3 +102,4 @@ * K64F with Ethernet. * NUCLEO_F411RE with ESP8266. +* ODIN-W2 with WiFi.