[comp.sys.sun] Maximum Swap per Process Limit in SUNOS 4.0

murthy@algron.cs.cornell.edu (Chet Murthy) (12/20/89)

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--

jms@tardis.tymnet.com (Joe Smith) (01/03/90)

In article <3992@brazos.Rice.edu> murthy@algron.cs.cornell.edu (Chet Murthy) writes:
>X-Sun-Spots-Digest: Volume 8, Issue 228, message 4 of 18
>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.

It looks like you have run into a hardware limit.

I found the following in "Writing Device Drivers", Part No: 800-1780-10,
Revision A, of 24 April 1989 (which is part of the 4.0.3 "Change Pages and
Addenda to the Docubox", Part No: 800-3378-10, Revision A of 24 April
1989).

Pages 79 and 80, topic "Selecting a Virtual to Physical Mapping", says
that the Sun-4/260 has two virtual address spaces of 512 magabytes in
size.

The diagram on page 85 shows the block diagram of the Sun-4 MMU.  It shows
that the context register plus 12 high address bits are used to index into
the segment map and look up a 9 bit quantity.  These 9 bits, plus 5 middle
address bits, plus 13 low address bits = 27 bits = 2**27 words = 128 mega
words = 512 mega bytes.

The manual said nothing about the Sun-4x architechure; maybe it has a
larger virtual address space.  But it looks like you are maxed out on your
4/260.

Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-D21    | PDP-10 support: My car's license plate is "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."