title: SVG drag memory leak
body: <p>I've implemented a simple draggable rectangle using raphael.js:</p>
  
  <pre><code>var paper = Raphael('container', '100%', '100%');
  var elements = paper.rect(10, 20, 300, 200).attr({ fill: "#FC0" });
  var o_x, o_y;
  elements.drag(function (dx, dy, x, y, e) {
      elements.translate(x - o_x, y - o_y);
      o_x = x;
      o_y = y;
  }, 
  function (x, y, e) {
      o_x = x;
      o_y = y;
  },
  function (e) { });
  </code></pre>
  
  <p>With the following html:</p>
  
  <pre><code>&lt;div id="container"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>After dragging the rectangle and shaking a lot for about 20 seconds, memory usage shoots up 200mb, and dragging becomes very unresponsive. What's the problem with my code? I've tested this on firefox 22.</p>
  
  <p>Here's a jsfiddle link: <a href="http://jsfiddle.net/jyhAx/" rel="nofollow noreferrer">http://jsfiddle.net/jyhAx/</a></p>
  
  <p><code>.transform()</code> however appears to work without memory leaks.</p>