[Patches] Revised patch for _PyResize_Tuple memory leak

Christian Tismer tismer@tismer.com
Wed, 19 Apr 2000 13:35:28 +0200


Charles G Waldman wrote:
> 
> This patch replaces my submission of Sun, 16 Apr and addresses Jeremy
> Hylton's suggestions that we also limit the size of the free tuple
> list.  I chose 2000 as the maximum number of tuples of any particular
> size to save.

I think this limit is great. It limits the cashed
data to about 540000 words.

K, L = 3+1, 3+20 ; print reduce(lambda x,y:x+y, range(K, L+1))*2000

This makes me think of integers which are cashed as well.
After some big range expressions, we have thousands of thousands
of integer slots available, eating memory.

In this case, things are more difficult, since integers are
alloted in pages. Not so bad, but we might end up
with many many pages where only a few ints are used.

Any ideas how to limit this acache as well?

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com