Closed butaikis closed 1 month ago
Hi @butaikis,
Memory consumption increases temporarily during deserialization; that's when the peak is reached.
In other words, the "regular" RAM usage corresponds to the final JsonDocument
, whereas the peak accounts for the temporary overhead of deserializeJson()
.
Best regards, Benoit
@bblanchon Understood, thanks for the explanation. Please tell me if I use the reading from LittleFS function.
DynamicJsonDocument BUFFER_JSON(61440);
File FRead= FS_User.open("/test.json", "r");
DeserializationError error = deserializeJson(BUFFER_JSON, FRead);
FRead.close();
Is it more correct to choose Input: Stream in the assistant?
LittleFS's File
implements the Stream
interface; that's why you can pass it directly to deserializeJson()
.
In the Assistant, you should, therefore, choose "Stream" for the input type.
By the way, in ArduinoJson 7, you can simply declare your document as JsonDocument BUFFER_JSON;
.
@bblanchon Thanks!
You're welcome, @butaikis. Thank you for using ArduinoJson! Don't forget to cast a star to support the project :wink:
Hi. I sometimes use an assistant for approximate calculation of the JSON buffer and there is a question. There is RAM Usage on the page, there is the main value and just below it is Peak. In which cases is the Peak value reached?