title: Haskell HDBC memory leak
body: <p>I tried putting together a resource pool and HDBC the other day but noticed that the memory keeps rising for each query. I then put together a simple test code using as few functions as possible and got this:</p>
  
  <pre><code>data SQL = SQL (Pool Connection)
  check :: SQL -&gt; IO ()
  check (SQL pool) = do res &lt;- query' pool "show status like 'Threads_conn%'" []
                        threadDelay 100000
                        check (SQL pool)
  </code></pre>
  
  <p>Whole code:
  <a href="http://upaste.me/40f2229cef7157f" rel="nofollow">http://upaste.me/40f2229cef7157f</a></p>
  
  <p>For each recursion of the check function, the program uses more and more memory. Shouldn't the result be garbage collected at a new recursive call or will it stay in memory until the program exits that function in case "we need it"?</p>