LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] determining how much memory is shared between multiple processes?

[ILUG] determining how much memory is shared between multiple processes?

Justin Mason jm at jmason.org
Sun Oct 3 23:31:48 IST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Paul Jakma writes:
> On Sun, 3 Oct 2004, Justin Mason wrote:
> 
> >  t: SHR  --  Shared Mem size (kb)
> >    The amount of shared memory used by a task.  It simply reflects
> >    memory that could be potentially shared with other processes.
> >
> > but some investigation seems to indicate that on my 2.6.6 system, 
> > that *only* applies to code pages loaded from shared libraries; 
> > pages allocated on the heap are never listed in this field, even if 
> > they are unmodified and therefore, presumably, shared.
> 
> Sounds like top simply uses the VmLib value (and probably + VmExe 
> value) from /proc/<pid>/status, used the source? ;)

Can't say I have -- yet ;)

pretty close though -- 

: jm 1313...; top -b -n1 | grep sharetest
23784 jm        16   0 1032 37148  31m 2620    0  0.0  3.6   0:04 sharetest
23788 jm        22   0 1032 37148  31m 2620    0  0.0  3.6   0:02 sharetest

: jm 1258...; sudo cat /proc/23784/status
Name:   sharetest
State:  T (stopped)
SleepAVG:       90%
Tgid:   23784
Pid:    23784
PPid:   3298
TracerPid:      0
Uid:    1000    1000    1000    1000
Gid:    1000    1000    1000    1000
FDSize: 256
Groups: 4 24 25 29 44 105 115 432 1000
VmSize:    37148 kB
VmLck:         0 kB
VmRSS:     32464 kB
VmData:    34512 kB
VmStk:        16 kB
VmExe:       996 kB
VmLib:      1528 kB
Threads:        1
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000000080
SigCgt: 0000000080000000
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000

VmStk+VmExe+VmLib = 2540, which is pretty close to 2620.

> > Anyone got any good tips for ways to figure this out?
> 
> I dont think even the kernel knows ;) - well it used not to. With 
> rmap in the kernel, it now probably does, however I dont see any 
> obvious place where that information is exposed..

hmm. wonder if there's an instrumentation module that'd do it...

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFBYH3UQTcbUG5Y7woRAg9tAKDKuv0j7HvTskdbL/l4IeFMqjThcwCfR6gD
6qykk0DYeGzsu1ICpmSbrZ8=
=hImO
-----END PGP SIGNATURE-----




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell