Below code is having memory leak. It's running under ruby 2.1.1. I am not able to find the actual leak.
q = Queue.new("test")
while true do
m = q.dequeue
body = JSON.parse(m.body)
user_id = body["Records"][0]
user = V2::User.find(user_id)
post = V2::Post.find(post_id)
end
After few hours of run I added GC.start but its not solving the problem
q = Queue.new("test")
while true do
m = q.dequeue
body = JSON.parse(m.body)
user_id = body["Records"][0]
user = V2::User.find(user_id)
post = V2::Post.find(post_id)
GC.start
end
I don't know how to find the actual memory leak.