title: Ruby code memory leak in loop
body: <p>Below code is having memory leak. It's running under ruby 2.1.1. I am not able to find the actual leak.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>After few hours of run I added GC.start but its not solving the problem</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I don't know how to find the actual memory leak.</p>