'''memory management''' is the activity and art of allocating and deallocating resources that occupy memory. ** Description ** In languages like [C], programmers must concern themselves with '''direct memory management''', using [pointer%|%pointers] to keep track of memory that has been allocated from the heap, and devising a strategy for determine when to deallocate the memory. Tcl shields programmers from direct memory management at the script level, but deciding when to deallocate resources that occupy memory is still very much part of the life of someone programming in higher-level languages. Most languages and systems are designed around some combination of automatic and manual memory management. In higher-level languages, memory management is related to [scope] and [namespace%|%namespaces]. When a scope terminates, the values associated with that scope are deleted. When the values are not shared, the space they occupy in memory is recovered. In Tcl every value backed by a [Tcl_Obj], a [C] structure which typically occupies 48 bytes in memory. ** See Also ** [copy-on-write]: Understanding when a logical copy of a value in a Tcl script becomes a real copy in memory is one of the keys to effective memory management in Tcl. [garbage collection]: [K]: contains information about how to unshare values to prevent copies, which can have a big impact on memory when values are large. [shared-memory]: [Tcl Performance]: performance is often related to memory management <> fundamentals