Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* resource limit question
@ 1994-09-05 19:37 Jingwen Wang
  0 siblings, 0 replies; only message in thread
From: Jingwen Wang @ 1994-09-05 19:37 UTC (permalink / raw)


    It looks like the OSF memoryuse limit (RLIMIT_RSS) cannot be changed as
documented by setrlimit(2). It always sets RLIMIT_RSS current (soft) limit
to 100, no matter what value I specify. The following code:

#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>

extern getrlimit(int, struct rlimit *);

int
main()
{
    struct rlimit rl;

    rl.rlim_cur = 30000;
    rl.rlim_max = RLIM_INFINITY;
    if (setrlimit(RLIMIT_RSS, &rl) < 0)
	perror("setrlimit");
    else
	printf("setrlimit RLIMIT_RSS ok\n");

    if (getrlimit(RLIMIT_RSS, &rl) < 0) {
	perror("oops!\n");;
	exit(-1);
    }
    printf("RLIMIT_RSS: rl.rlim_cur=%lu rl.rlim_max=%lu\n", rl.rlim_cur,
    rl.rlim_max);

    exit(0);
}

   I ran it as root and I always get:

   setrlimit RLIMIT_RSS ok
   RLIMIT_RSS: rl.rlim_cur=100 rl.rlim_max=9223372036854775807

   Any ideas why rl.rlim_cur is not set to 30000?

   Thanks.

Jingwen Wang
Computer Systems Research Institute
University of Toronto
6 Kings College Road
Toronto, Ont., Canada M5S 1A1

E-mail: jwang@sys.toronto.edu
Tel:    (416)-978-1675



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1994-09-05 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-09-05 19:37 resource limit question Jingwen Wang

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