Maximum Swap per Process Limit in SUNOS 4.0

Chet Murthy murthy at algron.cs.cornell.edu
Wed Dec 20 16:44:25 AEST 1989


Does anybody out there know how to increase the max datasize per process
limit under SUNOS 4.0?  I have a sun-4/260 here with 1.6Gigabytes of swap,
and I'd like to use most of that for a really big symbolic processing job.

I'm currently getting a "mere" 512MB (1/2 Gig) right now per process.

Also, the setrlimit(2) call does not work as advertised, as far as I can
tell.  The following code, when run as root, does _not_ increase the data
limit:

#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
extern int errno;


struct rlimit rl;

main(ac,av)
int ac;
char **av;
{
	int rv,i=0;
	rv = getrlimit(RLIMIT_DATA,&rl);
	printf("%d,%d\n",rl.rlim_cur,rl.rlim_max);
	if(rv == -1) printf("read failed, %d\n",errno);
	rl.rlim_cur = 513*1024*1024;
	rl.rlim_max = 513*1024*1024;
	rv = setrlimit(RLIMIT_DATA,&rl);
	if(rv == -1) printf("failed, %d\n",errno);
	rv = getrlimit(RLIMIT_DATA,&rl);
	if(rv == -1) printf("read failed, %d\n",errno);
	printf("%d,%d\n",rl.rlim_cur,rl.rlim_max);

}

As you can tell, the code first gets and prints out the data size limit,
then increases it to 513 MB, sets it, reads it back out, and prints out
the value just read.  I check the error codes and all, and yet it does NOT
increase the data limit.

Again, any help would be greatly appreciated.

Thanks,
--chet--



More information about the Comp.sys.sun mailing list