Skip to content

Instantly share code, notes, and snippets.

@mstruve
Created June 16, 2021 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstruve/9b4c85e20b79c701bbb75d2c81e9e571 to your computer and use it in GitHub Desktop.
Save mstruve/9b4c85e20b79c701bbb75d2c81e9e571 to your computer and use it in GitHub Desktop.
HeapDumpWorker
require 'objspace'
class HeapDumpWorker
include Sidekiq::Worker
sidekiq_options queue: :medium_priority
def perform(filename)
File.open(filename, 'w') do |f|
ObjectSpace.dump_all(output: f, full: true)
end
puts "wrote it!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment