Re: Python memory handling
- From: frederic.pica@xxxxxxxxx
- Date: 31 May 2007 06:15:18 -0700
On 31 mai, 14:16, Marc 'BlackJack' Rintsch <bj_...@xxxxxxx> wrote:
In <1180611604.247696.149...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, frederic.pica
wrote:
So as I can see, python maintain a memory pool for lists.
In my first example, if I reparse the xml file, the memory doesn't
grow very much (0.1 Mb precisely)
So I think I'm right with the memory pool.
But is there a way to force python to release this memory ?!
AFAIK not. But why is this important as long as the memory consumption
doesn't grow constantly? The virtual memory management of the operating
system usually takes care that only actually used memory is in physical
RAM.
Ciao,
Marc 'BlackJack' Rintsch
Because I'm an adept of small is beautiful, of course the OS will swap
the unused memory if needed.
If I daemonize this application I will have a constant 40 Mb used, not
yet free for others applications. If another application need this
memory, the OS will have to swap and loose time for the other
application... And I'm not sure that the system will swap first this
unused memory, it could also swap first another application... AFAIK.
And these 40 Mb are only for a 7 Mb xml file, what about parsing a big
one, like 50 Mb ?
I would have preferred to have the choice of manually freeing this
unused memory or setting manually the size of the memory pool
Regards,
FP
.
- Follow-Ups:
- Re: Python memory handling
- From: Thorsten Kampe
- Re: Python memory handling
- References:
- Python memory handling
- From: frederic . pica
- Re: Python memory handling
- From: Marc 'BlackJack' Rintsch
- Python memory handling
- Prev by Date: Re: file reading by record separator (not line by line)
- Next by Date: Re: wxpython demo error on debian etch
- Previous by thread: Re: Python memory handling
- Next by thread: Re: Python memory handling
- Index(es):
Relevant Pages
|