[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Resource limit question



On Sat, Mar 24, 2001 at 04:29:38PM -0500, Martin Weinberg wrote:
> 
> I have set a hard limit on memoryuse to 10000 (10M).  limits (or
> ulimit -a) shows the limit but, it doesn't seem to be working.
> For example, with the limit set the following bit of code
> 
> ============================================================
[sniped code]
> ============================================================
> 
> compiled as follows:
> 
> 	 cc tst.c
> 
> give me the output:
> 
> RSS limit curr, max: 10240000, 10240000
> weinberg 25601 11.0 16.2 41000 20836 pts/1   S    16:25   0:00 ./a.out
> 
> Note the RSS limit of 10M.  But the code as a data size of
> 20M to start and mallocs an additional 20M.  What am I missing?

that the kernel does not have a proper bean counter so these resource
limits don't work.  

the only way to limit memory usage is to limit `virtual memory' use
ulimit -v or the `as' limit in /etc/security/limits.conf.  

> P.S. This is a pure potato system.  The limit itself is set by
> pam_limits from the limits.conf file.  I assume that this part
> is fine because the "limits" or "ulimit -a" correctly reports
> the values set in limits.conf and /var/log/auth.log reports that
> pam has read and set the value (with the debug flag set).

yup, your not doing anything wrong, the kernel is just broken.  its
unlikely to be fixed until 2.6 either, at the soonest.  

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpo1m7QGoOB4.pgp
Description: PGP signature


Reply to: