Bugs item #1399099, was opened at 2006-01-07 18:04
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1399099&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Leo Jay (leojay)
Assigned to: Nobody/Anonymous (nobody)
Summary: i get a memory leak after using split() function on windows

Initial Comment:
my environment is: python 2.4.2 on windows xp 
professional with sp2

what i do is just open a text file and count how many 
lines in that file:

D:\>python
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for 
more information.
>>> f = file('b.txt', 'rt')   # the size of b.txt is 
about 100 mega bytes
>>> print len(f.read().split('\n'))
899830
>>> f.close()
>>> del f
>>>

after these steps, the task manager shows that the 
python process still hog about 125 mega bytes memory. 
and the python don't release these memory until i 
quit the python.

but i find that if i remove the split() function,  
python acts right:

D:\>python
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for 
more information.
>>> f = file('b.txt', 'rt')
>>> print len(f.read())
95867667
>>>


so, is there something wrong with the split function? 
or it's just my misuse of split?


Best Regards, 
Leo Jay

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1399099&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to