[Python-Dev] refleaks and caches (original) (raw)

Christian Heimes lists at cheimes.de
Mon Jan 28 03:13:32 CET 2008


Neal Norwitz wrote:

I'm not sure we should expose an API to clear the cache, but I don't have strong opinions either way. If we keep the ability to clear the cache, should we also consider some control over the int/float freelist? These are worse than the tuple/frame free lists since int/floats are unbounded. I suspect the method free lists in Objects/methodobject.c and Objects/classobject.c don't have that many entries that could be removed.

Do the int/float free lists cause any trouble or can they eat lots of memory? And what about the string intern list?

The biggest problem I have with the patch is the attribute name. I would prefer underscores. ie cleartypecache instead of cleartypecache. Attributes in sys are currently inconsistent, but it seems that most of the newer names have underscores. (Aside: if we are going to move attrs out of sys for py3k, we should consider renaming them to be consistent too. Regardless of moving them, should we rename them.)

The attribute name is the least problem. It's easy to fix. Brett came up with a nice idea, too. He suggested the gc module as the place for the function.

Christian



More information about the Python-Dev mailing list