size of text/data space of running process

Dave Cornutt dave at murphy.UUCP
Thu Aug 14 04:32:02 AEST 1986


Relay-Version: version B 2.10.1 6/24/83; site houligan.UUCP
Path: houligan!novavax!ucf-cs!peora!codas!akguc!akgua!gatech!seismo!columbia!caip!clyde!burl!ulysses!bellcore!whuxcc!lcuxlm!whuxl!whuxp!picuxa!warren
From: warren at picuxa.UUCP
Newsgroups: net.unix-wizards
Subject: size of text/data space of running process
Message-ID: <149 at picuxa.UUCP>
Date: Wed, 6-Aug-86 16:58:52 EDT
Article-I.D.: picuxa.149
Posted: Wed Aug  6 16:58:52 1986
Date-Received: Wed, 13-Aug-86 03:34:02 EDT
Distribution: net
Organization: AT&T Information Systems, Parsippany N.J.
Lines: 24
Keywords: SYS V

In article <149 at picuxa.UUCP>, warren at picuxa.UUCP types:

>How can one determine the amount of space taken up by a process,
>broken up into text and data [being run shared by several users]?
>...
>One suggestion is to get the text size from the "size" command
>and assume that the rest of [ps] SZ is data (accounting for page size).
>Does this work?

I'm not a SYS5 guru, but it should work.  In all of the UN*X implementations
that I'm aware, the size of the text segment is fixed at load time;
it doesn't change during execution.  Just subtract the text segment size
(as reported by "size") from the total size shown by ps for each process,
then add it back to the sum.

This assumes that the ls -N option wasn't used to link the program.  If
it was, the text is not shared.  If you don't know this, you can
determine it by doing "file <name-of-executable-file>" on the program.
If it says something that includes the words "pure executable", the
text is sharable.

---
"Pick it up and put it in your pocket, or somebody else will" - Stan Ridgeway

Dave Cornutt, Gould Computer Systems, Ft. Lauderdale, FL
UUCP:  ...{sun,pur-ee,brl-bmd}!gould!dcornutt
 or ...!ucf-cs!novavax!houligan!dcornutt
ARPA: wait a minute, I've almost got it...

"The opinions expressed herein are not necessarily those of my employer,
not necessarily mine, and probably not necessary."



More information about the Comp.unix.wizards mailing list