# Process.setrlimit question

**URL:** <https://www.ruby-forum.com/t/process-setrlimit-question/126056>\
**Category:** Ruby\
**Created:** [January 15, 2008, 3:44am UTC](https://www.ruby-forum.com/t/process-setrlimit-question/126056 "2008-01-15T03:44:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [January 15, 2008, 3:44am UTC](https://www.ruby-forum.com/t/process-setrlimit-question/126056/1 "2008-01-15T03:44:09Z")

</div>

why does this not blow up?

cfp:~ \> cat a.rb  
require ‘yaml’

factor = 100000000000000000

soft, hard = Process.getrlimit Process::RLIMIT\_RSS  
y ‘soft’ =\> soft, ‘hard’ =\> hard

Process.setrlimit Process::RLIMIT\_RSS, soft/factor, hard/factor

soft, hard = Process.getrlimit Process::RLIMIT\_RSS  
y ‘soft’ =\> soft, ‘hard’ =\> hard

s = 42.chr \* (soft + 1)  
s[-1]

## cfp:~ \> sudo ruby a.rb; echo $?

## hard: 9223372036854775807 soft: 9223372036854775807

hard: 92  
soft: 92  
0

i sort of expect this to get signaled and throw an exception?

cheers

a @ [http://drawohara.com/](http://drawohara.com/)

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [January 15, 2008, 4:09am UTC](https://www.ruby-forum.com/t/process-setrlimit-question/126056/2 "2008-01-15T04:09:52Z")

</div>

On Jan 14, 7:42 pm, “ara.t.howard” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## Process.setrlimit Process::RLIMIT\_RSS, soft/factor, hard/factor soft: 9223372036854775807
> 
> hard: 92  
> soft: 92  
> 0
> 
> i sort of expect this to get signaled and throw an exception?

What platform?

Dan

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [January 15, 2008, 4:29am UTC](https://www.ruby-forum.com/t/process-setrlimit-question/126056/3 "2008-01-15T04:29:43Z")

</div>

On Jan 14, 2008, at 8:07 PM, Daniel B. wrote:

> What platform?

osx - tiger

a @ [http://drawohara.com/](http://drawohara.com/)

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [January 15, 2008, 6:18am UTC](https://www.ruby-forum.com/t/process-setrlimit-question/126056/4 "2008-01-15T06:18:24Z")

</div>

On Jan 14, 8:28 pm, “ara.t.howard” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Jan 14, 2008, at 8:07 PM, Daniel B. wrote:
> 
> > What platform?
> 
> osx - tiger

setrlimit() doesn’t work on OS X.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [January 16, 2008, 1:25am UTC](https://www.ruby-forum.com/t/process-setrlimit-question/126056/5 "2008-01-16T01:25:39Z")

</div>

ara.t.howard wrote:

> On Jan 14, 2008, at 10:17 PM, Daniel B. wrote:
> 
> > setrlimit() doesn’t work on OS X.
> 
> well gosh - that’d explain it - doh! 😉
> 
> seriously though - you’d think it’d throw like fork does on windows  
> though eh?

You would think. I’ve hit other situations like this with OS X, too. ☹

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [January 15, 2008, 6:26am UTC](https://www.ruby-forum.com/t/process-setrlimit-question/126056/6 "2008-01-15T06:26:35Z")

</div>

On Jan 14, 2008, at 10:17 PM, Daniel B. wrote:

> setrlimit() doesn’t work on OS X.

well gosh - that’d explain it - doh! 😉

seriously though - you’d think it’d throw like fork does on windows  
though eh?

thanks a bunch!

a @ [http://codeforpeople.com/](http://codeforpeople.com/)
