def free_up_memory(self):
        """Clear accumulated data that won't be reused.

        Used just before loading a new file, so data
        accumulated from the edition of the previous file
        (in case there was one) isn't kept around now that
        another file is being loaded.

        The previous file edited might be the one being
        loaded (that is, the file is reloaded). However,
        even if it is the case, this measures should still
        save memory, since data/objects present in
        the past session may not be needed anymore in
        the new session.
        """
        ### clear collections containing native file data,
        ### node instances and text block instances

        for attr_name in (
            'nodes_data',
            'text_blocks_data',
            'node_map',
            'text_blocks',
        ):

            try:
                obj = getattr(self, attr_name)
            except AttributeError:
                pass
            else:
                obj.clear()
Clear accumulated data that won't be reused.

        Used just before loading a new file, so data
        accumulated from the edition of the previous file
        (in case there was one) isn't kept around now that
        another file is being loaded.

        The previous file edited might be the one being
        loaded (that is, the file is reloaded). However,
        even if it is the case, this measures should still
        save memory, since data/objects present in
        the past session may not be needed anymore in
        the new session.
        
nodezator/graphman/main.py