Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!uwm.edu!linac!att!news.cs.indiana.edu!nstn.ns.ca!cs.dal.ca!ug.cs.dal.ca!donaldc From: donaldc@ug.cs.dal.ca (Donald Chisholm) Newsgroups: comp.unix.questions Subject: Setting hard limits on resident memory? Keywords: setrlimit, limit, csh Message-ID: <1991Apr3.174023.10162@cs.dal.ca> Date: 3 Apr 91 17:40:23 GMT Sender: news@cs.dal.ca (USENET News) Followup-To: donaldc@ug.cs.dal.ca Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada Lines: 26 Originator: donaldc@ug.cs.dal.ca Nntp-Posting-Host: ug.cs.dal.ca 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@ug.cs.dal.ca