[Python-Dev] Interning filenames of imported modules
Charles G Waldman
cgw@fnal.gov
Wed, 10 Jan 2001 15:57:41 -0600 (CST)
I have a question about the following code in compile.c:jcompile (line 3678)
filename = PyString_InternFromString(sc.c_filename);
name = PyString_InternFromString(sc.c_name);
In the case of a long-running server which constantly imports modules,
this causes the interned string dict to grow without bound. Is there
a strong reason that the filename needs to be interned? How about the
module name?
How about some way to enforce a limit on the size of the interned
strings dictionary?