Project

General

Profile

Misc #19052 » thread_test.rb

 

def print_memory
puts "statm resident Memory: #{Hash[%i{size resident shared trs lrs drs dt}.zip(open("/proc/#{Process.pid}/statm").read.split)][:resident].to_i * 4}"
puts open("/proc/#{Process.pid}/smaps_rollup").read
puts "--------------------------------------"
end

puts "Before thread"
print_memory

threads = []

10.times do |i|
threads << Thread.new do
end
end

threads.each(&:join)

puts "After thread ended"
print_memory
(2-2/2)