title: SystemOutOfMemory exception after working with Stream
body: <p>That function rotates image stream on 90 degrees.
  After I call it 5-6 times at Windows Phone I got <code>SystemOutOfMemory</code> exception</p>
  
  <pre><code>private WriteableBitmap _rotate(Stream stream)
  {
      var bmp = new BitmapImage();
      bmp.SetSource(stream);
      var src = new WriteableBitmap(bmp);
      var w = src.PixelWidth;
      var h = src.PixelHeight;
      var p = src.Pixels;
      var dst = new WriteableBitmap(h, w);
      var i = 0;
      var rp = dst.Pixels;
      for (var x = 0; x &lt; w; x++) {
          for (var y = h - 1; y &gt;= 0; y--) {
              var srcInd = y * w + x;
              rp[i] = p[srcInd];
              i++;
          }
      }
      /* Trying to free memory, but nothing of that works */
      //bmp = null;
      //src = null;
      return dst;
  }
  </code></pre>
  
  <p>I know that problem in that function, cause when I'm not calling - all works fine.</p>