-
Notifications
You must be signed in to change notification settings - Fork 53
Memory Management
Memory is expensive- the more Memory in use the more expensive it is to parse it. Limit memory use where possible.
Do not use Room memory. Doing so will prevent that room's memory from getting cleaned.
If you want to use segments you should probably use VRAM
(read below). However, if you are positive that VRAM is not appropriate you should make sure to use the sos.lib.segments
library and not attempt to directly access the segments themselves.
VRAM
is a wrapper built on top of segments. It's designed to minimize the number of stringify/parse calls. sos.lib.vram.getData(key)
returns the object saved in VRAM which should be manipulated directly. If the object is changed at all then sos.lib.vram.markDirty(key)
needs to be called to let the library know it needs to flush the data to a segment.
To mark the segments for this specific piece of VRAM
as critical call sos.vram.lib.markCritical(key)
. This will ensure that it is always loaded- however if too many are marked as critical then other data will not be able to load.