From: jwang@sys.toronto.edu (Jingwen Wang)
Subject: resource limit question
Date: 5 Sep 94 19:37:44 GMT [thread overview]
Message-ID: <1994Sep5.153743.3756@jarvis.cs.toronto.edu> (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
reply other threads:[~1994-09-05 19:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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