Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created October 14, 2015 18:45
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 tenderlove/87ccc44bacca6c4c6f9d to your computer and use it in GitHub Desktop.
Save tenderlove/87ccc44bacca6c4c6f9d to your computer and use it in GitHub Desktop.
require "objspace"
require "miq-process"
start_time = Time.now
done = false
first = true
def iter n
if n > 0
1.times{
iter(n-1)
}
else
# null code
end
end
def gc
iter(100)
GC.start
GC.start
end
ManageIQ::Providers::Vmware::InfraManager.module_eval do
def use_vim_broker?; false; end
end
require 'miq_fault_tolerant_vim'
def do_the_thing
ObjectSpace.trace_object_allocations_start
e = ExtManagementSystem.first
e.verify_credentials
EmsRefresh.refresh(e)
e.clear_association_cache
e = nil
gc
end
EmsRefresh.init_console
do_the_thing
require 'miq_fault_tolerant_vim'
gc
done = true
gc
#binding.pry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment