Created
May 25, 2010 03:47
-
-
Save cghawthorne/412737 to your computer and use it in GitHub Desktop.
Ruby GC settings wrapper: http://thefjord.org/2010/05/24/default-gc-parameters-for-ruby-enterprise-edition/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <errno.h> | |
int main(int argc, char* argv[]) { | |
setenv("RUBY_HEAP_MIN_SLOTS", "650000", 0); | |
setenv("RUBY_GC_MALLOC_LIMIT", "50000000", 0); | |
// Optional GC logging | |
//setenv("RUBY_GC_STATS", "1", 0); | |
//char log[100]; | |
//snprintf(log, 100, "/tmp/ruby_gc_%d.txt", getpid()); | |
//setenv("RUBY_GC_DATA_FILE", log, 0); | |
execv("/opt/ruby-enterprise-1.8.7-nnn/bin/ruby.real", argv); | |
fprintf(stderr, "Ruby Wrapper: error starting real ruby: %s\n", strerror(errno)); | |
return(EXIT_FAILURE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment