base64 memory question
Hi ng,
I see that after en encoding with base64, the memory used for the
variable that I use for store the encoded data, after deleted, python
keep a part of that memory:
#ls -lh on /tmp/test_zero
#-rw-r--r-- 1 michele michele 9,8M 2006-03-31 18:32 /tmp/test_zero
michele:~$ python2.4
Python 2.4.2 (#2, Nov 20 2005, 17:04:48)
[GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import base64
# Now top say me:
6217 michele 15 0 4412 2536 3336 S 0.0 0.3 0:00.01 python2.4
b = base64.encodestring(open("/tmp/test_zero", "rb").read())
#top:
6217 michele 15 0 39156 36m 3376 S 19.6 4.8 0:00.60 python2.4
del base64, b
#top
6217 michele 15 0 25644 23m 3376 S 0.0 3.1 0:00.61 python2.4
So like I can read from the top, python "forgot" to free that part of
memory. Is this normal? Is there a solution for free that memory?
P.s. The same happen on my win2k machine with py 2.4.2
Thanks,
Michele
.
Relevant Pages
- Re: 2.6, 3.0, and truly independent intepreters
... just the GIL being in place, but of course it's there for a reason. ... Python faster on single core machines and more stable on multi core ... Other language designers think the same way. ... with languages that use memory pointers, have the potential to get out ... (comp.lang.python) - Re: why cannot assign to function call
... a porch the same if all its ... actual Python objects tend to be mutable only if they are ... In CPython, the id is given by the memory location of the object, which ... significant changes and replacements and add-ons that nevertheless don't ... (comp.lang.python) - Re: Writing huge Sets() to disk
... that this code takes a lot of extra memory. ... > I believe it's the references problem, ... It's a bit unfortunate that all those instance variables are global to ... it merely aggregates it for use in storing new Python objects. ... (comp.lang.python) - Re: Memory Leaks and Heapy
... I'm trying to plug some memory leaks in a TurboGears program. ... and simplejson for message passing between the server ... I'm using Heapy. ... means there are not many leaked objects in the python space. ... (comp.lang.python) - Re: Newbie completely confused
... Your program uses quite a bit of memory. ... And really, reading 30MB files should not be such a problem, right? ... 'del LINES' deletes the lines that are read from the file, but not all of your data structures that you created out of them. ... The python code loads a module written in C++ and some of the member variables actually point to C++ objects created dynamically, so one actually has to call their destructors before unbinding the python var. ... (comp.lang.python) |
|