Skip to content

Crash under high memory pressure #76

@pljakobs

Description

@pljakobs

I can pretty reliably drive ConfigDB to crash when an ESP8266 is relatively low on free Heap (usually due to a relatively large number of http requests - like loading the web page) and then fetching one of the larger database streams (/config returns a ~3.5kB object, /data a 6kB object)
it seems to happen more frequently on the /config endpoint, despite the correspondign object being smaller, but app-config, the db behind it, consists of multiple stores.

181711629 [CFGDB] open 'app-config/color.json' failed
181727068 [CFGDB] open 'app-config/sync.json' failed
E:M 104
E:M 96
E:M 96
E:M 448
E:M 448
E:M 448

Does splitting a structure into multiple stores increase the memory footprint significantly, when streaming the whole database?

I am gating my api endpoints by checking for what I think should be enough free heap, for the /info and /config endpoints, I check for 12kB free and otherwise send a "TOO_MANY_REQUESTS" and ask the client to back off for as second, but 12kB seems not to be enough for my config structure.

stacktrace.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions