[Zope] Python use more and more memory

Dieter Maurer dieter@handshake.de
Fri, 13 Dec 2002 22:25:13 +0100


ken writes:
 > Felix Ulrich-Oltean at 14:36 (UTC-0000) on Wed, 11 Dec 2002 said:
 > 
 > = On Wed, Dec 11, 2002 at 09:27:07AM -0500, ken wrote:
 > = > Dieter Maurer at 20:18 (UTC+0100) on Tue, 10 Dec 2002 said:
 > = > = Terry writes:
 > = > =  > 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?
 > = > ...
 > = > Maybe I'm missing something, but I see the %MEM staying at 10.4; SHARE 
 > = > and SIZE are likewise staying the same.  Seems that it's behaving itself 
 > = > quite well.  Or...?
 > = 
 > = I think the listing is a snapshot at one time - the lines are the
 > = different threads and the memory figures are in fact shared memory.
 > = The percentage is 10.4, but the actual size is 94M, which compared to
 > = 26M at the beginning is a sizeable increase.
 > = ...
 > 
 > Working from that and looking at the second instance, we can see that
 > process 5022 has been running for 0.00 (just started, presumably), but 
 > still has claimed 92M, the same as other processes which have been 
 > running much longer.
The various processes you see represent the different threads
comprising your Zope.

By definition, threads share most of the process resources, this
includes the address space. Therefore, all threads have the
same memory, they share it, whether or not they still did any work
by themselves.


Dieter