On Dec 10, 2007 1:36 AM, JLIST <[EMAIL PROTECTED]> wrote:
>
> Sure. Here you go (I removed the user column) -
>
> top - 01:32:11 up 12 days, 11:58,  1 user,  load average: 0.00, 0.01, 0.00
> Tasks:  44 total,   1 running,  43 sleeping,   0 stopped,   0 zombie
> Cpu(s):  0.0% us,  0.0% sy,  0.0% ni, 100.0% id,  0.0% wa,  0.0% hi,  0.0% si
> Mem:   1548000k total,   723556k used,   824444k free,        0k buffers
> Swap:        0k total,        0k used,        0k free,        0k cached
>
>   PID    PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 19581    16   0 10760 7636 1796 S    0  0.5   0:12.13 squid
> 22383    16   0 70724 6932 2380 S    0  0.4   0:02.20 python
> 22385    16   0 70720 6856 2356 S    0  0.4   0:01.67 python
> 22367    16   0 60472 6764 2340 S    0  0.4   0:01.39 python
> 22369    16   0 60472 6764 2340 S    0  0.4   0:01.68 python
> 22373    16   0 60472 6764 2340 S    0  0.4   0:01.68 python
> 22375    16   0 60472 6764 2340 S    0  0.4   0:01.67 python
> 22371    16   0 60464 6760 2340 S    0  0.4   0:01.79 python
> 22377    16   0 60464 6760 2340 S    0  0.4   0:01.38 python
> 22380    16   0 60464 6760 2340 S    0  0.4   0:01.64 python
> 22384    16   0 60464 6760 2340 S    0  0.4   0:01.62 python
> 22364    16   0 60580 6496 2380 S    0  0.4   0:01.47 python
> 22365    16   0 60588 6496 2380 S    0  0.4   0:01.73 python
> 10022    15   0  6908 2380 1792 S    0  0.2   0:00.02 sshd
> 10008    15   0  6908 2332 1756 S    0  0.2   0:00.01 sshd
> 29919    16   0  7392 2016  980 S    0  0.1   0:21.87 sendmail
> 29928    16   0  6496 1632  820 S    0  0.1   0:00.01 sendmail
> 22363    16   0  4056 1408  772 S    0  0.1   0:00.69 lighttpd

This is completely normal.  Python is using a total of about 28 MB of
RAM here for all 12 processes.  The "used" value at the top of the
output does not mean "total amount of resident memory of all
programs".  It means "total amount of physical memory used for
*something*".  That "something" includes buffers and cache.  For
example, the kernel will use any free physical RAM to cache recently
read files.  This is a wonderful thing, since the RAM was just sitting
there doing nothing anyway.  But it means that the "used" value in top
is effectively meaningless.  You can see the actual amount of memory
being used with the "free" command:

[EMAIL PROTECTED] ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1035728     600544     435184          0      94124     235716
-/+ buffers/cache:     270704     765024
Swap:      2096472      14680    2081792

When I run top, it says "600656k used".  But free shows me that, when
buffers and cache are excluded, there's really only 270704k used.

Seriously, there's nothing wrong with Linux's memory management and
Python is using a perfectly reasonable amount of memory.  Are you
having some performance problem that prompted this interest in memory
usage?  Maybe we can talk about that instead. ;)

-- 
Gary
http://blog.extracheese.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to