Subject: Re: managing process memory limits on the fly?
To: Martin S. Weber <Ephaeton@gmx.net>
From: Carl Brewer <carl@bl.echidna.id.au>
List: netbsd-users
Date: 02/22/2007 12:30:08
Martin S. Weber wrote:
> On Thu, Feb 22, 2007 at 11:11:08AM +1100, Carl Brewer wrote:
>>
>> Hello,
>>
>> I've a process running (zope, python, plone) that is running into
>> the default 128MB memory limit for processes.  I'd like to
>> bump it up to 256MB or so.  Is it possible to do that on the fly
>> to a process (like one can renice something as root?), or do I need
>> to change the memory limit for all process with sysctl?
> 
> You can do it on the fly with sysctl; check sysctl proc.<pid>.rlimit
> and/or set these values. See the first paragraph after description
> of cmd line ooptions in sysctl(8).

ok, thanks.  I tried this on a jammed up zope process, and saw the 
following :

rollcage2# sysctl proc.23242.rlimit.datasize.hard
proc.23242.rlimit.datasize.hard = 1073741824
rollcage2# sysctl -w proc.23242.rlimit.datasize.hard=2147483648
proc.23242.rlimit.datasize.hard: 1073741824 -> 2147483648
rollcage2# sysctl proc.23242.rlimit.datasize.hard
proc.23242.rlimit.datasize.hard = 1073741824


so it didn't actually do anything.  Did I do something wrong?

uname -a
NetBSD rollcage2.bl.echidna.id.au 3.1 NetBSD 3.1 (GENERIC) #0: Tue Oct 
31 04:27:07 UTC 2006 
builds@b0.netbsd.org:/home/builds/ab/netbsd-3-1-RELEASE/i386/200610302053Z-obj/home/builds/ab/netbsd-3-1-RELEASE/src/sys/arch/i386/compile/GENERIC 
i386