[Zope] Python use more and more memory

Oliver Bleutgen myzope@gmx.net
Wed, 11 Dec 2002 01:23:09 +0100


Dieter Maurer wrote:
> Terry writes:
>  > The memory used by python getting more and more.
>  > Is that a normal behavoir.
>  > 
>  > In beginning I start Zope.
>  > the python use about 26M memory.
>  > 
>  > After several hours
>  > get the result by "top"
>  > Sort by memory usage
>  > 
>  > PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
>  > 4931 www-data 13 0 94324 92M 2504 S 3.5 10.4 7:43 python
>  > 5022 www-data 9 0 94324 92M 2504 S 0.0 10.4 0:00 python
>  > 5023 www-data 9 0 94324 92M 2504 S 0.0 10.4 15:55 python
>  > 5024 www-data 14 0 94324 92M 2504 S 14.5 10.4 16:55 python
>  > 5025 www-data 10 0 94324 92M 2504 S 0.3 10.4 15:35 python
>  > 5026 www-data 9 0 94324 92M 2504 S 0.0 10.4 16:32 python
>  > 
>  > Have any idea why?
> That is not unusual.
> 
> Zope makes extensive use of caches. They get filled over time
> and consume memory.
> 
> Only, when memory consumption grows unbounded, you want to start
> looking for leaks. There is a "LeakFinder" product to help you
> in this case.


In addition, search for ChrisD's AutoLance product on zope.org, which 
restarts zope if it's memory usage goes over a configurable threshold.

It's a band-aid solution, but it works quite well.

cheers,
oliver