Setting hard limits on resident memory?

Donald Chisholm donaldc at ug.cs.dal.ca
Thu Apr 4 03:40:23 AEST 1991


	I have a question regarding hard limit setting for resident
memory.  The system I'm on is a Sun OS UNIX release 4.1.

	I have tried to set a hard limit for a program I'm running, I've
tried the following:

1. Setting the limit from the shell (csh)  limit -h memory 2000k

	I get the error that the hard limit may not be changed. My current
limit is "unlimited" and my understanding was hard limits could be lowered.

2. Setting the limit within the program using setrlimit.

	This seems to work (I get no errors), the problem is it doesn't
seem to do anything.  The program still grows to a resident size larger than
2000k.  It is possible I've done it wrong, yet I did it as the manual noted.

	My question is simply how can I put a cap on the resident memory size
of a program? 

Please respond by E-mail...thanks.

                          Donald Chisholm

donaldc at ug.cs.dal.ca



More information about the Comp.unix.questions mailing list