Memory Usage

SNAP Protocol

Type Allocated
Global Buffer Pool 46
UART Budget 36
Mesh Routing Budget 10
RPC Budget 10
Radio Budget 10
STDOUT Budget 10

SNAPpy Virtual Machine

Both strings and byte lists work from the same pool of buffers.

Type SNAP 2.6 and after Before SNAP 2.6
Number of Tiny Strings 16 N/A
Tiny String Size 1 character N/A
Number of Small Strings 32 14
Small String Size up to 16 characters same
Number of Medium Strings 16 8
Medium String Size up to 126 characters same
Number of Large Strings 9 N/A
Large String Size up to 255 characters N/A

System

Type SNAP 2.6 and after Before SNAP 2.6
Global Variables 255 128
Concurrent Local Variables 64 same
Maximum Call Stack Depth 16 same

Note

Byte lists defined in global spaces effectively contain multiple (one-byte) variables in one global variable space. Byte lists defined in global spaces must be copied to RAM before they can be manipulated. One way to do this is:

list = list[:]