Hi Lina,
may be I am missing something, but a matrix 500x500 at 4 bytes per
cell occupies 1MB of memory. At 8 bytes per cell 2MB respectively. How
does this relate to the 500/900MB of memory limit? As I understand,
your dataset is 800 observations and -spatwmat- produces a matrix
800x800.
Could you run the following and tell us what happens?
clear
set mem 100m <-- or whatever your maximum is
set matsize 800
matrix Z=J(800,800,0)
matrix dir
matrix A=J(800,800,0)
matrix dir
matrix B=J(800,800,0)
matrix dir
matrix C=J(800,800,0)
matrix dir
use "mydata" <--- whatever your dataset is
If it works fine, than it is not a memory issue, but rather you'd have
to look into the source code of -spatwmat- to find if the memory is
used there efficiently (e.g. it does not generate 800 temporary
matrices).