title: Returning a base64 image without memory leak ASP.NET MVC 3
body: <p>I have some images stored in a database as base64 strings and need to return them from an MVC controller. How can I do that without a memory leak?</p>
  
  <p>Previously I was using this:</p>
  
  <pre><code>return File(Convert.FromBase64String(pictureString), "image/jpeg");
  </code></pre>
  
  <p>However, the w3wp process starts using up a whole heap of memory for a few photos.</p>
  
  <p>Is there a proper way to do this? Currently I've decided just to set each image to data:image/jpg;base64,string_here and it uses a lot less memory.. but it seems to be a lot slower loading the page too.</p>
  
  <p>Any help is appreciated.</p>