title: When array count increases, getting this error "failed to allocate memory (NoMemoryError) zlib(finalizer): the stream was freed prematurely."
body: <p>I am having this weird error</p>
  <pre><code>failed to allocate memory (NoMemoryError)
  zlib(finalizer): the stream was freed prematurely.
  </code></pre>
  <p>When I try to do this, it goes well with the first iteration</p>
  <pre><code>array.each_slice(40000) do |result|
     #writing this result array into the excel
  end
  </code></pre>
  <p>But when the second iteration goes, it thows above mentioned error. What's the problem here? Someone can help me here?</p>
  <p>The same problem is occurring in the first iteration if the count is 50000.</p>