title: Searchkick memory leak
body: <p>Running <code>rake searchkick:reindex  CLASS=Product</code> for an application causes the Rake process to leak memory; after about 15-20 minutes it's bad enough to freeze a Debian system with 16GB of RAM. There are ~3800 &quot;Product&quot; records.</p>
  <p>I managed to work around this problem with the following code in a Rake task:</p>
  <pre><code>connection = ActiveRecord::Base.connection
  res = connection.execute('select max(id) from products')
  id = res.getvalue(0,0)
  1.upto(id) do |i|
    p = Product.find_by_id(i)
    next unless p
  
    p.reindex
  end
  </code></pre>
  <p>This is also a little quicker.</p>
  <p>Can anyone suggest a means to investigate this memory leak? It would be useful to do so in more detail before considering opening a ticket.</p>