[Top][All Lists]

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

Re: ulimit bug

From: Dmitry V. Levin
Subject: Re: ulimit bug
Date: Sat, 5 Mar 2011 22:36:44 +0300


On Sat, Mar 05, 2011 at 03:36:39PM +0300, Sergey Zhumatiy wrote:
>   Hello!
>   I just had discover (on my back) ulimit command bug.
>   There is "resident set" limit, which is set in PAGES. But ulimit 
> command shows it as kBytes. On by system page size size is 4Kb, so 
> difference is four times...
>   Simple test (using raw getrlimit call) shows, that ulimit sets and 
> shown PAGES, but not kBytes. Please, fix it!

Looks like you've got it all wrong.
ulimit -m operates in units of 1024 pages each:

$ strace -e setrlimit bash -c 'ulimit -m 1'
setrlimit(RLIMIT_RSS, {rlim_cur=1024, rlim_max=1024}) = 0
$ strace -e setrlimit bash -c 'ulimit -m 1234'
setrlimit(RLIMIT_RSS, {rlim_cur=1234*1024, rlim_max=1234*1024}) = 0


Attachment: pgpKSxlesnMDy.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]