memory allocation

benevilent at optusnet.com.au benevilent at optusnet.com.au
Sun Sep 19 14:28:45 EDT 2004


My latest understanding is that the default memory allocation will result
in arenas being created to fulfill the maximum memory requirements of the
program. If memory is freed, the program still occupies the amount of
memory occupied by these arenas. If allocations can be fulfilled without
creating new arenas, then no additional memory will be required. 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?

On Sun, 19 Sep 2004 21:21:21 +1000, benevilent at optusnet.com.au wrote:

> Hey,
> 
> I'm trying to debug the memory allocation in an embedded use of the
> Python interpreter.
> 
> The longer I leave my program running the more memory it consumes. The
> total number of objects in the system is not increasing (many are being
> allocated and deallocated).
> 
> Using mtrace I have established that the only memory which is not being
> freed is that which is allocated at Objects/obmalloc.c:429. It appears to
> be allocating new arenas in proportion to it's running time.
> 
> I don't have an in-depth understanding of Python's object allocator. Does
> anybody have any ideas as to what the problem may be?
> 
> Thanks,
> Laurie




More information about the Python-list mailing list