Managing references from one document to another

When managing references to many documents within JavaScript, it is important to destroy these references when a document is no longer needed. For example, if a document was in a pop-up window, in a frame, in an inline frame or in an object, and the document was dismissed by the user, the document's nodes will remain in memory and will continue to bloat the DOM. Destroying these unused references can improve performance considerably.