Skip to content

Instantly share code, notes, and snippets.

Created March 23, 2015 23:07
Show Gist options
  • Save anonymous/936f4da32bc3f37ffdb8 to your computer and use it in GitHub Desktop.
Save anonymous/936f4da32bc3f37ffdb8 to your computer and use it in GitHub Desktop.
memory leak with Net::HTTP
require 'net/http'
uri = URI('http://google.com')
request = Net::HTTP::Get.new(uri)
loop do
sleep 1
Net::HTTP.start(uri.host, uri.port) do |http|
http.request(request).body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment