Good evening,

I’m new to Julia and I was trying to rewrite a MATLAB code, to speed it up. The main problem is that the code generates an “Out of Memory” error and I don’t understand why.

Outside a while loop I define

```
A=kron(J,Kx)+kron(Ay,J);
Id=I(N*N); #I use sparse matrices package
K=Id+(2.*D.*dt.*theta).*A;
R_app=Id-2.*D.*dt.*(1-theta).*A;
```

where J, Kx, Ay are sparse matrices, dt, D and theta are scalars and N is integer. Here everything works fast, without any errors.

Then, inside the while loop, I update K and R_app (due to the change of dt)

```
K=Id+(2.*D.*dt.*theta).*A;
R_app=Id-2.*D.*dt.*(1-theta).*A;
```

but it goes Out of Memory.

Could someone help me, please? Thank you in advance!

P.S. I put the double * just in this question, not in the real code.