Contents Previous Next Subchapters

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

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.

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

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

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