<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
V pythonu 2.5 jiz funguje spravne. Po del a se uvlni cela pamet<br>
<br>
Petr Zlamal napsal(a):
<blockquote cite="mid:4A55DB60.4030808@gmail.com" type="cite">
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
No me to funguje nejak divne (python 2.4.4) a v programu top:<br>
<br>
Python 2.4.4 (#2, Oct 22 2008, 20:20:22)<br>
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import gc<br>
>>> a = ["%d" % i for i in xrange(0, 50000000)] #17.1% pameti<br>
>>> del a
#14.7% pameti<br>
>>><br>
>>> gc.collect()
#14.7% pameti <br>
0<br>
>>> <br>
<br>
Petr Hlávka napsal(a):
<blockquote
cite="mid:e5258fb30907080706k15c9faa5ge5732e41b9f02fa8@mail.gmail.com"
type="cite">
<pre wrap="">Dobry den,
(v uvodu clanku pisou, ze popisovany problem by mel byt opraven od
verze 2.5), kdyz zkusim
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">import gc
a = ["%d" % i for i in xrange(0, 5000000)]
del a
gc.collect()
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->
tak python 2.2 naalokuje a nasledne uvolni 200 MB pameti - k volani
gc.collect() by doslo pozdeji automaticky taky. Je mozne, ze pro mensi
alokace pameti si interpretr necha pamet v bufferu a nebude ji ihned
vracet OS.
S pozdravem Petr Hlavka.
2009/7/8 Dan Pressl <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E" href="mailto:nu.frix@gmail.com"><nu.frix@gmail.com></a>:
</pre>
<blockquote type="cite">
<pre wrap="">At me nekdo zkusenejsi opravi, ale pokud vim, tak to rucne nelze.
Viz. <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://evanjones.ca/python-memory.html">http://evanjones.ca/python-memory.html</a>
2009/7/8 Petr Zlamal <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E" href="mailto:p.zlamal@gmail.com"><p.zlamal@gmail.com></a>:
</pre>
<blockquote type="cite">
<pre wrap="">Pratele,
Potreboval bych poradit jak uvolnit pamet v pythonu, respektive jak
odstranit nepotrebnou instanci tridy z pameti. Zkousel jsem prikaz del. Po
provedeni "del" na instanci tridy je vsak pamet zaplnena furt stejne
(sledovano pomoci top v linuxu). Mozna na to jdu uplne spatne. Vi nekdo jak
provest uvolneni?
Dekuji
Vepro
_______________________________________________
Python mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:Python@py.cz">Python@py.cz</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.py.cz/mailman/listinfo/python">http://www.py.cz/mailman/listinfo/python</a>
</pre>
</blockquote>
<pre wrap="">
--
^nu.friX
aka Dan Pressl
Reality is useless & F4Q DMNC!!!
Every syntax creates code. And code is poetry.
_______________________________________________
Python mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:Python@py.cz">Python@py.cz</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.py.cz/mailman/listinfo/python">http://www.py.cz/mailman/listinfo/python</a>
</pre>
</blockquote>
<pre wrap=""><!---->_______________________________________________
Python mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:Python@py.cz">Python@py.cz</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.py.cz/mailman/listinfo/python">http://www.py.cz/mailman/listinfo/python</a>
</pre>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>