New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbage collection not working correctly in Python 2.3 #45746
Comments
when running this script: It does not give back the memory even a import gc
gc.collect() afterwards does not do it. In Python 2.5 the memory is freed again correctly, at least under Windows. The problem came up, because I was parsing a CSV file of 50 MB which |
I'm sorry but Python 2.3 is long gone. Its maintenance cycle has ended |
No, I can't. |
See if gc.set_threshold (0, 0, 0) helps. |
How do you know the memory isn't given back? It may be available for |
Looks like the memory _is_ freed. As Guido said, "It may be available paul@gonzo:~$ python
Python 2.3.5 (#2, Oct 16 2006, 19:19:48)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gc
>>> len ([object for object in gc.get_objects () if isinstance (object,
list)])
25
>>> aList = []
>>> for i in xrange(5E5):
... aList += [[]]
... for j in xrange(10):
... aList[-1].append([]
...
...
KeyboardInterrupt
>>> aList[-1].append([]
KeyboardInterrupt
>>>
paul@gonzo:~/emacs$ python
Python 2.3.5 (#2, Oct 16 2006, 19:19:48)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gc
>>> len ([object for object in gc.get_objects () if isinstance (object,
list)])
25
>>> aList = []
>>> for i in xrange(5E5):
... aList += [[]]
... for j in xrange(10):
... aList[-1].append([])
...
__main__:1: DeprecationWarning: integer argument expected, got float
>>> del aList
>>> len ([object for object in gc.get_objects () if isinstance (object,
list)])
25 |
Meh, copied too much. Disregard first part, second shows it. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: