Xref: utzoo alt.sys.sun:3793 comp.unix.admin:1772 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nnews!uunet!elroy.jpl.nasa.gov!ncar!csn!boulder!tigger!panos From: panos@tigger.Colorado.EDU (Panos Tsirigotis) Newsgroups: alt.sys.sun,comp.unix.admin Subject: Re: Memory usage questions Keywords: Sun, memory, ps Message-ID: <1991May8.215340.21137@colorado.edu> Date: 8 May 91 21:53:40 GMT References: <1991May8.151630.12279@DMI.USherb.CA> <1991May8.170752.13521@Think.COM> Sender: news@colorado.edu (The Daily Planet) Organization: University of Colorado, Boulder Lines: 26 Nntp-Posting-Host: tigger.colorado.edu In article <1991May8.170752.13521@Think.COM> barmar@think.com writes: >In article <1991May8.151630.12279@DMI.USherb.CA> beauchem@roselin.DMI.USherb.CA (Denis Beauchemin) writes: >>I am trying to compute the amount of main memory used by some processes and I >>don't know exactly what to look at in the ps output. When I do a "ps aux" I >>get the SZ and RSS fields that detail memory usage. Is one a subset of the >>other or do I have to add them up to get the real picture? > >It's a little more complicated than that. > >SZ is the size of the data and stack segments of the process. This is >basically the amount of swap space that is being used (the text segment is >paged directly out of the object file and shared libraries). SZ <= amount of swap space used because of dynamic linking. The text segment is mapped in from the object file using MAP_PRIVATE mapping. Then ld.so does the linking causing some pages to change causing copy-on-write's. The changed pages will be backed up in the swap space. The non-changed pages will be backed up by the object file. Panos -- ---------------------------------------------------- | Panos Tsirigotis, CS grad | | Computer Science Dept., U. of Colorado @ Boulder | | Boulder, CO 80309 |