Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.)
Subject: Re: Available process memory on OSF 3.2
Date: 1996/09/05	[thread overview]
Message-ID: <50njil$j9u@nntpd2.cxo.dec.com> (raw)
In-Reply-To: 50l1nv$jev@clic3.qbc.clic.net



In article <50l1nv$jev@clic3.qbc.clic.net>, tessierr@berclain.com (Richard Tessier) writes:

>I'm looking for a way to get the amount of memory that is available
>for a process. Under several other UNIX platforms (HPUX, SCO ...) we
>use the available space for the data (using sbrk and ulimit) but this
>concept doesn't work under OSF (since it can allocate non-contiguous
>memory blocks, the result of sbrk(0) can be over ulimit(UL_GETBREAK)
>even if there is no segmentation fault). Is there a way to do
>something similar(or better !) that would work on OSF 3.2 ?

You can use getrlimit(2) to get the various memory limits for
data, stack and text.  You can use table(2) to find out how
much page/swap space is available and reserved, which is
usually the first limit you run into when allocating lots.
You can infer the swap mode by looking for the link
/sbin/swapdefault, but that can be wrong (recently removed
and the system not rebooted yet).  The last I knew finding
out with certainty required reading from /dev/kmem.

There might be other system parameters that will limit virtual
memory beyond what the R-limits do, but the amount of page/swap
space, swap mode and those limits should be enough to get a good
clue.

>Richard Tessier                         Berclain Group Inc.
--
Alan Rollow				alan@nabeth.cxo.dec.com




      parent reply	other threads:[~1996-09-05  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-04  4:00 Available process memory on OSF 3.2 Richard Tessier
1996-09-05  4:00 ` Brian Martin
1996-09-05  4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox