There's something in your question I don't understand:
If a process has 1gb in virtual memory, of which 500mb in physical,
then this means that it has 500mb in swap. Or in other words: 500mb that the 
process wanted in physical but couldn't. (isn't that what you asked to know)

Obviously I'm missing something here.

Anyway, few notes:
 - MM starts swapping *EVEN BEFORE* all processes hog the whole physical 
memory. That's because the kernel wants to leave some memory space for 
buffers/cache. So you may find yourself swapping idle pages while 
theoretically some physical memory might be freed. This behavior tunable 
via /proc/sys/vm/swappiness
- "free" command has an interesting 2nd line, which shows the net memory usage 
(i.e. without buffers/cache)
- The amazing "top" command can add a swap column; press "O", then "p" and 
enter. (If 'top' can do it, the per-process swap-vs.-physical data can 
probably be fetched from /proc/ some way, I don't know how, though)


On Tuesday 18 December 2007 02:36, Oded Arbel wrote:
> Hi List.
>
> I heard (but haven't actually seen) that in MS-Windows the system keeps
> track of some notion of "working set", which is supposedly (if I
> understand correctly) the total size of pages that an application
> referenced recently - whether these are currently resident or swapped
> out (see http://msdn2.microsoft.com/en-us/library/ms684891.aspx which is
> an MSDN article I found on the subject).
>
> The way I understand processes normally work (in Linux anyway) is that
> as long as there is enough memory available the memory manager keeps all
> pages that an application constantly references in physical RAM, and
> pages that are not references are swapped out after a while. A good
> example of such is a long running Java virtual machine process (at least
> the Sun implementation anyway) that doesn't return unused memory to the
> operating system letting it being swapped out until its needed again -
> so I have some jvm process which takes up some 1.5GB of virtual but less
> then 150MB resident: it was processing a lot of data some time in the
> past but now its idling.
>
> Now (again - according to my understanding) under contention - i.e. when
> processes need to use more physical memory then what is available - the
> memory manager keeps swapping stuff in and out of memory in an attempt
> to satisfy all requests. Under such conditions its might be useful to
> know - for each process - the amount of physical memory in use, the
> amount of virtual mapped to the process, but also how much of that
> virtual memory the process actually tries to use but can't get it all in
> physical RAM because other processes are also hogging the memory. Does
> such a thing exist in Linux?
>
> Thanks in advance
>
> --
> Oded
>
>
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to