systematically fetch heap mem settings, before allocating buffers so console and web show same results

This commit is contained in:
Proddy
2023-01-11 23:34:27 +01:00
parent 97451d2b7a
commit 3dc2ab54ac
4 changed files with 43 additions and 12 deletions

View File

@@ -100,6 +100,9 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
}
}
// capture current heap memory before allocating the large return buffer
emsesp::EMSESP::system_.refreshHeapMem();
// output json buffer
size_t buffer = EMSESP_JSON_SIZE_XXXLARGE;
auto * response = new PrettyAsyncJsonResponse(false, buffer);