Skip to content

Instantly share code, notes, and snippets.

@kwleland
Last active August 29, 2015 14:20
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 kwleland/4e788b9a091423118d21 to your computer and use it in GitHub Desktop.
Save kwleland/4e788b9a091423118d21 to your computer and use it in GitHub Desktop.
Garbage Collector Hang Repro
Thread.new do
while true
sleep 10
puts "heartbeat"
end
end
while true
ar = []
100.times do
thr = Thread.new do
while true
sleep 1
end
end
ar.push(thr)
end
puts ar.length
ar.each do |thr|
thr.kill
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment