Updated Memory model (markdown)

Benoît Blanchon
2016-11-13 20:45:56 +01:00
parent f7b5205125
commit 262e191af6

@@ -33,7 +33,7 @@ For the example above, it would be:
const int BUFFER_SIZE = JSON_OBJECT_SIZE(3) + JSON_ARRAY_SIZE(2); const int BUFFER_SIZE = JSON_OBJECT_SIZE(3) + JSON_ARRAY_SIZE(2);
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer; StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
If you're in this situation, [JsonBuffer size calculator](https://rawgit.com/bblanchon/ArduinoJson/master/scripts/buffer-size-calculator.html) will be of great help. If you're in this situation, [JsonBuffer size calculator](https://bblanchon.github.io/ArduinoJson/) will be of great help.
In the second case, let's say you dynamically generate a JSON object tree of a random complexity so you can't put a limit based on that. But on the other hand, you don't want your program to crash because the object tree doesn't fit in memory. In the second case, let's say you dynamically generate a JSON object tree of a random complexity so you can't put a limit based on that. But on the other hand, you don't want your program to crash because the object tree doesn't fit in memory.
The solution here is to determine how much memory is available, or in other words how much memory you can afford for the JSON object tree. The solution here is to determine how much memory is available, or in other words how much memory you can afford for the JSON object tree.