Instantly share code, notes, and snippets.

@jim /rmem.sh
Created Aug 11, 2010

Embed
What would you like to do?
export RUBY_HEAP_MIN_SLOTS=1000000 export RUBY_HEAP_SLOTS_INCREMENT=1000000 export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 export RUBY_GC_MALLOC_LIMIT=1000000000 export RUBY_HEAP_FREE_MIN=500000; "$@"
@burke

This comment has been minimized.

Show comment
Hide comment
@burke

burke Nov 5, 2010

Unless I'm missing some weird intricacy of how bash works, I'm pretty sure this sets those variables for any other scripts you call in your shell session too (which might be what you wanted). You could try https://gist.github.com/664234 if it isn't.

burke commented Nov 5, 2010

Unless I'm missing some weird intricacy of how bash works, I'm pretty sure this sets those variables for any other scripts you call in your shell session too (which might be what you wanted). You could try https://gist.github.com/664234 if it isn't.

@jim

This comment has been minimized.

Show comment
Hide comment
@jim

jim Nov 5, 2010

I'm far from a bash expert, but my understanding is that exports in scripts only affect child processes of that script, but not the parent environment. This was a surprise to me.

If I run rmem on the command line and then run env, I don't see these settings. But I can get them to 'stick' by running . rmem.

My testing has confirmed this, but I could easily have missed something about how bash works.

Owner

jim commented Nov 5, 2010

I'm far from a bash expert, but my understanding is that exports in scripts only affect child processes of that script, but not the parent environment. This was a surprise to me.

If I run rmem on the command line and then run env, I don't see these settings. But I can get them to 'stick' by running . rmem.

My testing has confirmed this, but I could easily have missed something about how bash works.

@burke

This comment has been minimized.

Show comment
Hide comment
@burke

burke Nov 5, 2010

Huh, cool. I didn't know that. Thanks for the blog post! I'm still playing around with settings a bit, but I'm down from 25 minutes to about 410 seconds :D

burke commented Nov 5, 2010

Huh, cool. I didn't know that. Thanks for the blog post! I'm still playing around with settings a bit, but I'm down from 25 minutes to about 410 seconds :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment