Contents Previous Next Subchapters

Garbage Collection of System Allocated Memory
Syntax garbage
See Also pack , load and save

Description
O-Matrix does on the fly garbage collection of memory; i.e., when memory is no longer needed, it is returned to one of its pools of available memory. In addition, fragmentation is avoided by joining neighboring memory when possible. Still, this memory is retained by O-Matrix and not returned to the system pool. The garbage script returns most of the O-Matrix memory pools to the system.

Example
If you enter
     clear
     function f(x) begin
          print "f(", x, ")"
     end
     x = 1
     garbage
     f(x)
O-Matrix will reply
     f(1)

Limitations
The garbage script cannot be used inside of begin - end pair.

Mlmode
In Mlmode , this function is called pack instead of garbage. If you continue the example above by entering
     mlmode
     pack
     f(x)
O-Matrix will reply
     f(1)