[Pythonmac-SIG] memory size for Python applets?

Jack Jansen Jack.Jansen@cwi.nl
Tue, 14 Jul 1998 10:33:24 +0200


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

Hmm, would the following be a good idea: if there was a cutoff point 
(user-settable) and anything allocated that is bigger than that cutoff point 
comes from temporary memory? The premise I'm working on here is that small 
things are likely to be long-lived (or, at least, you can't say much about 
them) but big things are more likely to be short lived. Big things are 
currently already directly allocated with NewPtr() and freed with 
DisposePtr(), so the change wouldn't be too difficult. (Small things are 
allocated together in 8Kb blocks which are never freed again).

Does anyone have any data on object size vs. object lifetime?

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

Well, for me it isn't true: I use Python in the background quite often. I also 
use Python in cooperation with other programs (through scripting) a lot, for 
instance to build new Pythons and such.

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

You're right, of course: I was mixing up temp memory and system memory here 
again. Temporary Memory is what I was think of all the time.
--
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