[Pythonmac-SIG] memory size for Python applets?

Jack Jansen Jack.Jansen@cwi.nl
Mon, 13 Jul 1998 11:18:50 +0200


> 
> Why don't we make Python attempt to allocate memory from the Process Manager
> (aka Temporary Memory), instead of just running out of memory?
> 
> Many applications do this, (Explorer, Netscape, RealPlayer), and it is
> completely within the rules of Macintosh application Development.

The way I read Inside Mac is that you shouldn't allocate temporary memory 
unless you only need it for a short while, especially if you're going to lock 
the block in memory. Since Python needs its blocks locked in memory 
(converting everything to use handles would be a major undertaking) and since 
there is no easy way to determine the expected lifetime of an object during 
allocation I have refrained from trying to use the system heap. If these 
assumptions are wrong, please tell me so: it would be *much* nicer to have 
Python use temporary memory, so you wouldn't have to be fiddling the 
application size everytime you run a big script.

Another thing I could do, of course, is to expose the NewSysHandle() call and 
friends. This would allow programmers to use temporary memory in some cases 
(but you would have to go quite a bit out of your way). But, of course, when 
MacOS becomes a real operating system next year with MacOS X all this will be 
moot as the memory model will be much more decent.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@cwi.nl      | ++++ if you agree copy these lines to your sig ++++
http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm