Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: available memory Message-ID: <847@auspex.UUCP> Date: 14 Jan 89 07:50:51 GMT References: <13490@cup.portal.com> <2428@daisy.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Distribution: na Organization: Auspex Systems, Santa Clara Lines: 20 >I'm not sure if this is exactly what you want, but on BSD UNIX (and SunOS) >you can getrlimit(2) on your data segment. I don't know about other >UNIXs. I think "ulimit" can be coaxed to do much the same thing in System V and maybe System III. Unfortunately, I don't know that it's what he wanted: > I understand that this number would not be guaranteed > for any length of time, especially in a multi-user system. I > really need to use it to instrument a program that is gobbling > inordinate amounts of RAM, It sounds as if he's interested in *physical* memory, rather than *virtual* memory; "getrlimit" and "ulimit" tells you how big the system's willing to let your data segment be, but if you make it that big it may not necessarily fit in memory all at once (or it may have to push everybody else out in order to do so). Unfortunately, there's no standard way of finding out how much free physical memory is free....