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
Memory keeping #42524
Comments
I execute this code on python 2.4.2 (authentic copy from
console):
Python 2.4.2 (#1, Oct 26 2005, 14:45:33)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more
information.
>>> a = range(1,10000000)
>>> del a before i type del - i run top and get (see console output after del (console below): I tried gc too ... but python didn't free memory. I checked some text from dmesg for you: |
Logged In: YES From what I understand, whether or not the Python runtime |
Logged In: YES Space for integer objects in particular lives in an immortal |
Logged In: YES Certainly, i 'am not a C guru, but i uderstood - if interpreter |
Logged In: YES Suggested close because and/or: |
Logged In: YES One more time.
>>> a = [1 for i in xrange(10000000)]
>>> del a
This code clear - and this not raise "memory keeping"(!)
>>> a = [i for i in xrange(10000000)]
>>> del a
But this code take about 163 Mb on my freeBSD. I can't
udestood why you don't care about this?
P.S. somebody explain me phrase "a) not a bug (integer
freelists)" |
Logged In: YES Integers are immutable. That is, each integer with a >>> a = 9876
>>> id(a)
9121340
>>> a += 1
>>> id(a)
8738760 It is assumed by the CPython runtime, based on significant When an integer object is allocated, the object hangs around Integer freelists are not going away, and the behavior you As Tim Peters suggested, if you need to iterate through 10 |
Logged In: YES sin_avatar, it's the number of integer objects _simultaneously I'm closing this as WontFix, as there are no plans to replace
It's a tradeoff: it's much easier to avoid in real life than it is to BTW, the idea that you might really need to create a list with |
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: