The memsize needed for shared memory (tested on linux system) can be calculated with:
For each varialbe you want to store: 24 Bytes
+ serialized var-size (see below) alligned by 4 Bytes
+ 16 Bytes
For a update of a var with the same key, the memory for the old var will be needed extra.