Ruby Malloc Limit: How to raise it higher

1.1k Views Asked by At

I am using ruby 1.9.3 with rails 3.1 and the memory usage for these things can get pretty large pretty fast. I have read around and it appears that the default ruby malloc limit is 8MB. This is pretty low and I have a lot of server to play around with. How can I raise the malloc limit to something like 1024 MB or so? I know the variable is RUBY_GC_MALLOC_LIMIT. I don't really want to have to custom compile the VM.

1

There are 1 best solutions below

0
On BEST ANSWER

If you are still looking for this you could try the malloc gem. You can custom set malloc items:

m = Malloc.new(1048576) #Number of bytes to allocate