[Pythonmac-SIG] memory size for Python applets?

Sean Hummel seanh@prognet.com
Sun, 12 Jul 1998 10:43:46 -0700


>> 
>> 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.

I know, I had the same problem with it when I first started using Temp
memory.  However in our case (RealPlayer that is,) most people aren't going
to be using another application when running our player.  

I'd say that the same is true for Python, most people run a Python script,
and wait for it to finish anyway.  I don't think Python is used for
background tasks as frequently.  I might be wrong, but that's how I see it.

>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.

Don't use the NewSysHandle() or NewSysPtr() calls, because if one of these
calls is made and it grows the System Heap, then the heap never shrinks to
reclaim that space.  (Even if you delete that ptr.)

>--
>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 
>
>



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                   Sean Hummel
                 RealNetworks Inc.
           Core Technologies Developer

"Just where are we going? And why are we in this
handbasket?"

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=