Python memory leak

uh@uhix.cube.net
Thu, 19 Jan 1995 14:37:55 GMT

Hi Python community,
testing around i got some strange behaviour.
Look at the following typescript:
--------------snip--snap----------------------
Script started on Thu Jan 19 09:17:35 1995
uh@uhix:~/Texte$ python
Python 1.1.1 (Dec 16 1994)
Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam
>>> import posix
>>> def ps():
... posix.system('ps -l | grep python | grep -v grep')
...
>>> file = open('BIG','r')
>>> ps()
0 1003 848 847 1 0 959 576 1172a1 S pp3 0:00 python
>>> buffer = file.read(4000000)
>>> ps()
0 1003 848 847 6 0 4867 4488 1172a1 S pp3 0:02 python
>>> len(buffer)
4000000
>>> del buffer
>>> ps()
0 1003 848 847 2 0 959 580 1172a1 S pp3 0:02 python
>>> # All OK
>>> file.seek(0,0)
>>> buffer = file.read(4090000)
>>> ps()
0 1003 848 847 7 0 4979 4600 1172a1 S pp3 0:06 python
>>> len(buffer)
4090000
>>> del buffer
>>> ps()
0 1003 848 847 1 0 4979 4600 1172a1 S pp3 0:06 python
>>>
uh@uhix:~/Texte$ exit
exit

Script done on Thu Jan 19 09:21:30 1995
--------------snip--snap----------------------

There seems to be a "magic border" around 4 MB.
Will this be fixed in 1.2 ??

BTW: File BIG is ASCII with 7148591 Bytes (ls -lr of a FTP-server)
I'm running:
Linux uhix 1.1.75 #1 Thu Jan 5 08:00:41 EST 1995 i486

Greetings
Uli

--
Uli Herold (un*x consultant)
uh@uhix.cube.net
Germany