Nodes
HC
Workspace Management
Workspace Queries
Nodes
Nodes
outputs a list of three numbers. The first represents the number of nodes of memory currently in use. The second shows the maximum number of nodes that have been in use at any time since the last invocation of NODES. (A node is a small block of computer memory as used by Logo. Each number uses one node. Each non-numeric word uses one node, plus some non-node memory for the characters in the word. Each array takes one node, plus some non-node memory, as well as the memory required by its elements. Each list requires one node per element, as well as the memory within the elements.)
If you want to track the memory use of an algorithm, it is best if you invoke GC at the beginning of each iteration, since otherwise the maximum will include storage that is unused but not yet collected.
There have been made extensions to the memory allocation code: it is now also possible to view the memory consumption in bytes on a per thread basis. This is the third element of the result of Nodes. This was essential for making memory quotas usable with runSecure.
Examples:
Nodes ;[8876 16855 59136] ;-)
Nodes ;[8876 8896 59104] ;-)
a=1234
Nodes ;[8879 8904 59088] ;-)
Nodes ;[8879 8903 59024] ;-)
erase [[][a]]
Nodes ;[8878 8906 58992] ;-)
Nodes ;[8878 8898 58944] ;-)
|
See also:
Examples:
References: