Memory and Variable Management 145
Why Is Garbage Collection Necessary?
The user data archive is divided into sectors. When you first begin
archiving, variables are stored consecutively in sector 1. This continues to
the end of the sector. If there is not enough space left in the sector, the
next variable is stored at the beginning of the next sector. Typically, this
leaves an empty block at the end of the previous sector.
Each variable that you archive is stored in the first empty block large
enough to hold it.
Note: An archived variable is stored in a continuous block within a single
sector; it cannot cross a sector boundary.
This process continues to the end of the last sector. Depending on the
size of individual variables, the empty blocks may account for a
significant amount of space.
Note: Garbage collection occurs when the variable you are archiving is
larger than any empty block.
How Unarchiving a Variable Affects the Process
When you unarchive a variable, it is copied to RAM but it is not actually
deleted from user data archive memory.
variable B
variable C
variable A
variable D
Depending on its size,
variable D is stored in
one of these locations.
Sector 1
Sector 3
Sector 2
Empty
block