This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Memory allocation for primitive types
Type: resource usage Stage:
Components: None Versions: Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: loewis, pitrou, Андрей.Давыдов
Priority: normal Keywords:

Created on 2010-10-13 14:19 by Андрей.Давыдов, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
memory.py Андрей.Давыдов, 2010-10-13 14:19
Messages (3)
msg118523 - (view) Author: Андрей Давыдов (Андрей.Давыдов) Date: 2010-10-13 14:19
Output for this script is

8.64453125
in test 163.80078125
in f 318.70703125
after f 280.49609375
in f 318.72265625
after f 280.50390625
0
164.4765625
126.26171875
10.01171875

If Python store all created objects of primitive types, why does it allocate (318 - 163) MB for call of function 'f'?
What memory does it free when call 'gc.collect()'
msg118524 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-13 14:30
I don't see any actual problem here. If you want help understanding Python's semantics, please post to comp.lang.python.
msg118560 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-10-13 18:37
It's probably more Python's implementation that Андрей is interested in, however, I agree that this is off-topic for this bug tracker, and that comp.lang.python might be a better place. You can also answer these questions by studying the Python source code, which you'll find at

http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2
History
Date User Action Args
2022-04-11 14:57:07adminsetgithub: 54294
2010-10-13 18:37:08loewissetnosy: + loewis
messages: + msg118560
2010-10-13 14:30:23pitrousetstatus: open -> closed

nosy: + pitrou
messages: + msg118524

resolution: not a bug
2010-10-13 14:19:08Андрей.Давыдовcreate