Skip to content

Instantly share code, notes, and snippets.

@jim
Created August 11, 2010 18:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jim/519454 to your computer and use it in GitHub Desktop.
Save jim/519454 to your computer and use it in GitHub Desktop.
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
Copy link

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
Copy link
Author

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
Copy link

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