title: Julia Memory Allocation for Addition of Two Matrices in place
body: <p>I'm curious why Julias implementation of matrix addition appears to make a copy. Heres an example:</p>
  
  <pre><code>foo1=rand(1000,1000)
  foo2=rand(1000,1000)
  foo3=rand(1000,1000)
  
  julia&gt; @time foo1=foo2+foo3;
    0.001719 seconds (9 allocations: 7.630 MB)
  julia&gt; sizeof(foo1)/10^6
  8.0
  </code></pre>
  
  <p>The amount of memory allocated is roughly the same as the memory required by a matrix of these dimensions.</p>
  
  <p>It looks like in order to process foo2+foo3 memory is allocated to store the result and then foo1 is assigned to it by reference.</p>
  
  <p>Does this mean that for most linear algebra operations we need to call BLAS and LAPACK functions directly to do things in place?</p>