vm_object resident_page_count and vmspace.vm_pmap.pm_stats.resident_count

2006-04-26 Thread kapil jain

Hi,
 
 What is the different between the 2 values:
 vmspace.vm_pmap.pm_stats.resident_count and
 the sum of 
 vm_object resident_page_count 
 of all objecsts in that vmspace?
 
  I thought they might be the same, but looks like they are not. For eg. for 1 
process I get from vmspace 168 pages, and 192 pages from objects sum. The 
resident size is taken from vmspace.
 Is it that one includes shared pages and the other doesn't?
 
 thanks
 kapil
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


top on freebsd and wired memory

2006-04-25 Thread kapil jain
Hi,
 
 I have a question, top on freebsd displays active, inactive and wired memory.
 Since kernel memory has to be non-pageable isn't it that user process resident 
memory should be active + inactive?
 However I see some discrepancy. For eg. active is 34M, inactive 116M.
 top -s 100 gives me resident sizes of all processes, if I sum them up it comes 
to about 75M. So where is the rest of 116+34-75 = 75M?
 
 thanks
 kapil
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: top on freebsd and wired memory

2006-04-25 Thread kapil jain
Thanks Erik.
 
 Yes, the shared memory in this case is double counted, which means more than 
75M is unacccounted for. 
 So if I understand correctly, the resident set size of all processes
 would be:  active  RSS  active + inactive?
 And all the kernel memory is included in the wired part (there may be some user
 space memory there if it is mlocked), none is in active or inactive.
 
 
Erik Trulsson [EMAIL PROTECTED] wrote: On Tue, Apr 25, 2006 at 02:35:54PM 
-0700, kapil jain wrote:
 Hi,
  
  I have a question, top on freebsd displays active, inactive and wired memory.
  Since kernel memory has to be non-pageable isn't it that user process
  resident memory should be active + inactive?

No.  'Inactive' can (and usually does) include memory that was used by
processes that are no longer running.


  However I see some discrepancy. For eg. active is 34M, inactive 116M.
  top -s 100 gives me resident sizes of all processes, if I sum them up it
  comes to about 75M. So where is the rest of 116+34-75 = 75M?

Keep in mind that the resident size of a process (as displayed by top(1) or
ps(1)) includes any shared libraries it is using.
Memory for shared libraries can however be shared between several different
processes.  If you have several instances of the same program running at the
same time their codepages are usually shared.

This means that the total memory used by a set of processes is usually
*less* then the sum of their size as displayed by ps(1) or top(1).



-- 

Erik Trulsson
[EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]