Storage Management
A good programming habit is not to use too much memory or at least to use memory as efficiently as possible.
Managing data is important. The existence of data in a computer must have its own lifespan or else there will come a point where there will be no more space for new data elements. Think of computer memory as a big bridge. Every new car on the bridge is a data element. If you keep adding cars onto the bridge without removing them then there will come a point where no more cars can fit in it. If you want to keep the bridge at a healthy capacity level then you have to keep moving the cars. Overloaded bridges are like overloaded storage locations in a computer. Overloading storage in your computer will cause your computer to slow down or even crash altogether.
The management of storage space in a computer is done in several ways. Every time a component is created, an access path to it is also created. These components have their own lifetimes and they can be accessed through names, identifiers, or pointers, whichever the programmer chooses.
Garbage is a data object that continues to exist despite having all access paths to it destroyed. A dangling reference is an access path that continues to exist after the lifetime of the associated data object. Managing garbage and dangling references can be done when inaccessible cells are created or when the list of available space becomes empty. The former is a more active approach while the latter is a more passive approach at managing data junk.
A good programming habit is not to use too much memory or at least to use memory as efficiently as possible. Memory is consumed by adding more and more data types to your program. If you add too many processes and elements into your program, your computer might simply crash or hang due to lack of memory. You certainly do not want this to happen.