def free_up_memory(self):
        """Call clear all items except for special characters.

        Check "Memory management" in the glossary.
        """
        ### backup (key, value) pairs for special chars
        ### temporarily

        key_value_pairs = [(char, self[char]) for char, _ in CHAR_VS_REPR_PAIRS]

        ### clear entire surface map
        self.clear()

        ### restore the (key, value) pairs backed up
        self.update(key_value_pairs)
Call clear all items except for special characters.

        Check "Memory management" in the glossary.
        
nodezator/textman/cache.py