From: Chris Gehlker Date: 2002-01-18T05:52:02+09:00 Subject: Re: Possible bug in Mac version? On 1/17/02 11:41 AM, "Josh Huber" wrote: > Chris Gehlker writes: > >> I couldn't find ulimit in my one Linux book. I'm guessing that it >> has something to do with setting how much stack and heap any user >> gets. Can't do that here. Every user gets all they want until the >> memory manager runs out of swap space. > > Er, try man pages: First place I looked. No ulimit. > ulimit [-SHacdflmnpstuv [limit]] > Provides control over the resources available to the shell and > to processes started by it, on systems that allow such control. > The -H and -S options specify that the hard or soft limit is > set for the given resource. A hard limit cannot be increased > once it is set; a soft limit may be increased up to the value > of the hard limit. If neither -H nor -S is specified, both the > soft and hard limits are set. The value of limit can be a > number in the unit specified for the resource or one of the > special values hard, soft, or unlim- ited, which stand for the > current hard limit, the current soft limit, and no limit, > respectively. If limit is omitted, the current value of the > soft limit of the resource is printed, unless the -H option is > given. When more than one resource is specified, the limit > name and unit are printed before the value. Other options are > interpreted as follows: > -a All current limits are reported > -c The maximum size of core files created > -d The maximum size of a process's data segment > -f The maximum size of files created by the shell > -l The maximum size that may be locked into memory > -m The maximum resident set size > -n The maximum number of open file descriptors (most > systems do not allow this value to be set) > -p The pipe size in 512-byte blocks (this may not be set) > -s The maximum stack size > -t The maximum amount of cpu time in seconds > -u The maximum number of processes available to a single user > -v The maximum amount of virtual memory available to the shell > > Are you sure darwin does not support setting a stack size limit? I'd > be surprised... As sure as I can be without buying the Mach 3 book. (Which I'm reluctant to do because Apple warns that it may not be useful for very much longer). You inspired me to really read a lot of stuff I'd only glanced at before, including some header files, and they really are claiming that the only limit is 4GB and Mach's two pagers control how much is stacks vs how much is heap. i.e. There is one pager managing the call stacks for all the threads in a process and another pager managing heap for the process. I'm no expert on Linux or FreeBSD but it seems that the shell owns processes it starts in a sense that is not true under darwin. In darwin, mach_init, PID 1, is the parent of everything. "All your process are belong to us" ;) -- War is God's way of teaching Americans geography. -Ambrose Bierce, writer(1842-1914)