Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jul 1997 22:07:33 -0600 (MDT)
From:      Marc Slemko <marcs@znep.com>
To:        hackers@freebsd.org
Subject:   figuring out size of unshared pages for a process
Message-ID:  <Pine.BSF.3.95.970706215854.4961O-100000@alive.znep.com>

next in thread | raw e-mail | index | archive | help
I have a large number of the same process (Apache) running.  I want to
figure out how much each process takes, ignoring all shared pages.

I don't see any option to ps to give me what I want.  Am I missing
something?

/proc/<pid>/map seems the closest I can get without dropping into the
kernel debugger and adding up the structures. 

One example:

0x1000     0x36000           45         0 r-x COW vnode
0x36000    0x38000            2         2 rwx COW vnode
0x38000    0x93000           45         7 rwx COW swap
0x93000    0x98000            0         0 rwx COW swap
0x98000    0xa0000            5         5 rwx     default
0x8036000  0x8044000         10         0 r-x COW vnode
0x8044000  0x8046000          2         0 rwx COW vnode
0x8046000  0x804f000          5         2 rwx COW swap
0x8050000  0x8053000          3         0 r-x COW vnode
0x8053000  0x8054000          1         0 rwx COW vnode
0x8054000  0x8065000          0         0 rwx     none
0x8065000  0x80c6000         68         0 r-x COW vnode
0x80c6000  0x80ca000          4         3 rwx COW vnode
0x80ca000  0x80e1000          9         8 rwx COW swap
0x80e1000  0x80ed000         12         0 rwx     default
0xefbde000 0xefbfe000         5         4 rwx COW swap

If I assume I can ignore all the COW stuff since it is presumably still a
reference to a shared physical page, there are only three map entries I
care about. 

Ideas on what the one with a type of none is, and should it be included?

Adding them up, I get ~150k which is about what seems right in theory,
although it feels like they are using _far_ more in reality, ie. the
system maxes out far sooner than it should if they were using 150k + a
little bit of kernel overhead per process.

Is my math valid?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970706215854.4961O-100000>