Created
June 16, 2021 19:52
-
-
Save mstruve/9b4c85e20b79c701bbb75d2c81e9e571 to your computer and use it in GitHub Desktop.
HeapDumpWorker
This file contains hidden or 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
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