(1) on most platforms, the stack cannot occupy all the RAM; for instance, it’s limited to 4KB on the ESP8266.
(2) there is a workaround (see How to reuse a
JsonBuffer? if you are looking for troubles).
malloc() to allocate its memory, and it may have to do this several times if it needs to grow. However, you can specify an initial size to the constructor, so as to make sure that the buffer is big enough and that no further allocation will be needed.
As a general rule, if your
StaticJsonBuffer is bigger than 2KB, then it may be a good time to switch to a