memory allocation
benevilent at optusnet.com.au
benevilent at optusnet.com.au
Mon Sep 20 01:53:15 EDT 2004
Hey Tim,
Thanks for the response.
On Mon, 20 Sep 2004 01:35:31 -0400, Tim Peters wrote:
[..]
>> Hence as time goes by the memory required by the program increases
>> (assuming increasing memory requirements of the application), and it will not
>> dynamically expand and contract with the memory allocations/deallocations
>> as you would expect with an ordinary program. Is my understanding of this
>> correct?
>
> Possibly. I personally don't expect simplistic behavior from programs
> that use only malloc and free, assuming that's what "an ordinary
> program" intends to mean here. The relationship between the platform
> malloc/free and "memory required by the program" is usually very
> complex. Throwing pymalloc into the mix too makes it even more
> complex. "memory required by the program" is ambiguous on its own on
> machines with virtual memory, due to distinguishing between RAM in use
> and paged-out virtual address space that's never referenced again.
For this discussion I will refer to the virtual memory occupied by the
program.
> [... later ...]
>
>> Is it possible to change the memory allocation scheme of Python so that I
>> can confirm this?
>
> You can build Python without pymalloc. I've never done that myself,
> so am not sure how to do it. Could be that passing --with-pymalloc=no
> would suffice.
I have built with this option, but to no avail. I can provide a sample
c program (which has it's virtual memory size expand and contract
dynamically), and a similar python program for which this does not
occur.
More information about the Python-list
mailing list