/etc/system variable for max process size?

/etc/system variable for max process size?

Post by Ben Mill » Thu, 20 Nov 1997 04:00:00



        Does anyone know of an /etc/system variable that will limit the size
that a user process can grow to, like 100MB?  I know maxuprc can be used to
limit the number of processes per user, but can't find one for the max size.

--
Ben Miller

http://www.eecis.udel.edu/~bmiller/

 
 
 

/etc/system variable for max process size?

Post by Steve Col » Thu, 20 Nov 1997 04:00:00



Quote:>    Does anyone know of an /etc/system variable that will limit the size
> that a user process can grow to, like 100MB?  I know maxuprc can be used to
> limit the number of processes per user, but can't find one for the max size.

This is part of every shell (that I know of).  Look up 'ulimit' or
'limits' in the man system.  If you need that for programs which are run
from a script or daemon, you can write a wrapper script so that the
spawned processes also have limitations.

For instance:

-- cut

#!/bin/sh
ulimit -v 120000
ulimit -H -v 120000
/opt/squid/bin/RunCache

-- cut

A wrapper I wrote to kill the squid beta process if it goes beyond 120MB
in size.  (http://squid.nlanr.net/)

Cheers,
Steve      |President & Systems Administrator,  Kingston Online Services
           |(e pluribus unix)    Multiple-T1    URL: http://www.kos.net/
           |Business and Education partners in SouthEastern Ontario
           |
           |"Through the firewall, out the router, down the T1, across the
           |backbone, bounced from satellite, it's nothing but net."
           |(forgive me if I'm terse, I answer hundreds of e-mails a day)