Were you able to figure out anything with this? Note that
the CPU usage of 90% does not imply how much memory
was being used.
Nothing leaps out about your code, but MATLAB is not a
language that I use. Another option would be to use
3dAutoTcorrelate, with which you could break the output
into pieces.