Hi, 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 -- ldv
pgprQsFJPKGee.pgp
Description: PGP signature