I guess my question should really have been more focussed. Obviously, Electron (application area) RAM is fixed and relatively small at 20KB and, if my rusty C brain is correct, data+bss is what I've used of that. So the heap+stack should have ~15KB of freedom.
My application has no explicit malloc()s, but has interrupts (small, variable setting, with typically a call to digitalRead), timers (some of which do a fair bit of non-blocking logic and typically call Log.trace() but no other 'deep' functions that I am aware of), main loop structures (calls to Cellular.command(), with its callback containing sscanf(), strncpy() and Log.trace()).
I guess these could put a reasonable amount of local variable and constant string parameter data on the stack if they managed to synch up in normal operation. Even so, I can't really see it getting anywhere more than a few KB total. I wasn't expecting a stack overflow risk.
Is there any tooling that can be used to investigate the stack/heap size in real-time?
The stats returned by Particle build for my current program:
Output of arm-none-eabi-size:
text data bss dec hex
34316 124 3364 37804 93
In a nutshell:
Flash used 34440 / 110592 31.1 %
RAM used 3488 / 20480 17.0 %