Skip to content

Instantly share code, notes, and snippets.

@jsanders
Last active December 12, 2015 05:59
Show Gist options
  • Save jsanders/4726220 to your computer and use it in GitHub Desktop.
Save jsanders/4726220 to your computer and use it in GitHub Desktop.
Resque memory test
for i in {1..10}
do
RUBY_HEAP_MIN_SLOTS=974 RUBY_HEAP_SLOTS_INCREMENT=1 RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 ruby test.rb &
sleep 1
pid=$!
ps -o rss -p $pid | tail -1
kill $pid
done 2> /dev/null | awk '{count+=1; sum+=$1}END{print sum/count}'
source 'https://rubygems.org'
gem 'json'
gem 'resque', '1.19.0'
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
Bundler.setup
require 'json'
require 'resque'
worker = Resque::Worker.new('test_queue')
worker.work(1)
@jsanders
Copy link
Author

jsanders commented Feb 7, 2013

What this all tells me is that there doesn't seem to really be a weird leak in resque, not sure what @diminish7 was seeing, but I think his memory parameters were just causing havoc.

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