[Python-Dev] Re: [Python-checkins] python/dist/src/Python import.c,2.210,2.211

Jack Jansen Jack.Jansen@oratrix.com
Fri, 29 Nov 2002 22:52:32 +0100

On vrijdag, nov 29, 2002, at 21:47 Europe/Amsterdam, 
jvr@users.sourceforge.net wrote:

> Update of /cvsroot/python/python/dist/src/Python
> In directory sc8-pr-cvs1:/tmp/cvs-serv20813/Python
> Modified Files:
> 	import.c
> Log Message:
> Slightly improved version of patch #642578: "Expose 
> PyImport_FrozenModules
> in imp". This adds two functions to the imp module: get_frozenmodules()
> and set_frozenmodules().

Something that's been bothering me about frozen modules in the 
classical sense (i.e. those that are stored in C static data 
structures) is that the memory used by them is gone without any chance 
at recovery. For big frozen Python programs that are to be run on small 
machines this is a waste of precious memory.

With modules "frozen" with set_frozenmodules you could conceivably free 
the data again after it has been imported (similar to what 
MacPython-OS9 does with modules "frozen" in "PYC " resources).

Would that be worth the added complexity?
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -