Have you tried setting [`$HistoryLength`][1] to zero:


The memory is not freed, because the previous data is still available by `Out[nn]` or `%nn`.

Note that if you do this, using `%`, `%%`, `%n` etc., which some people use in example code will not work. And when a large data set is shown the "Show More" and "Show Less" buttons do not work. You can bypass both problems by setting `$HistoryLength` to 1 while still conserving a lot of memory.

  [1]: http://reference.wolfram.com/mathematica/ref/$HistoryLength.html