Skip to content

sendHeader & F() #4266

Closed
Closed
@bstsoftorg

Description

@bstsoftorg

Basic Infos

To the developers:
Initially encountered a problem when using sendHeader, but this is true of many places.
There is a shortage of memory. Once stood 2.3.0-rc2, decided to move to 2.4.0, which was better, but some places are still eating RAM.
Possible enclose strings in F(). And not only where I point out in other places too.

Hardware

Hardware: ESP-12F
Core Version: 2.3.0-rc2, 2.4.0

Description

ESP8266WebServer.cpp
Global variables used 41524 bytes (50%) of dynamic memory, leaving 40396 bytes for local variables.
_srealm = F("Login Required");
Global variables used 41508 bytes (50%) of dynamic memory, leaving 40412 bytes for local variables.

Global variables used 41524 bytes (50%) of dynamic memory, leaving 40396 bytes for local variables.
sendHeader("WWW-Authenticate", String() + F("Basic realm="") + _srealm + F("""));
Global variables used 41508 bytes (50%) of dynamic memory, leaving 40412 bytes for local variables.

ESP8266HTTPClient.cpp
Global variables used 41524 bytes (50%) of dynamic memory, leaving 40396 bytes for local variables.
if (!beginInternal(url, String(F("https")).c_str())) {
Global variables used 41508 bytes (50%) of dynamic memory, leaving 40412 bytes for local variables.

Global variables used 41524 bytes (50%) of dynamic memory, leaving 40396 bytes for local variables.
if (!beginInternal(url, String(F("http")).c_str())) {
Global variables used 41508 bytes (50%) of dynamic memory, leaving 40412 bytes for local variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions