From help-octave-request at bevo dot che dot wisc dot edu Wed Feb 2 04:23:44 2000 Subject: memory problem From: "John W. Eaton" To: Daniel Heiserer Cc: "help-octave at bevo dot che dot wisc dot edu" Date: Wed, 2 Feb 2000 04:24:17 -0600 (CST) On 1-Feb-2000, Daniel Heiserer wrote: | The machine has sufficient memory to process my request. Apparently not. :-( How much virtual memory do you have? | octave:2> tic;eval(sprintf("L_%08d=eye(1000);",[1:1000]));toc | error: memory exhausted -- trying to return to prompt | | ......... | wd matrix 1000 1000 L_00000232 | wd matrix 1000 1000 L_00000233 | | ==> octave could create only 233 matrizes. That's about 233 * 1000 * 1000 * 8 ==> 1.8GB of data (unfortunately, even though eye produces a diagonal matrix, Octave currently uses a full matrix to store it). | In matlab it works fine. See below. | | I had an experience with fortran before, | where I had a memory limitation inside | a subroutine, but defining everything as | a common block it worked. Maybe that is | a hint .......... | | matlab: | >> tic;eval(sprintf('L_%08d=eye(1000);',[1:1000]));toc | | elapsed_time = | | 72.8044 | ................... | | L_00000999 1000x1000 8000000 double array | L_00001000 1000x1000 8000000 double array | | Grand total is 1000000000 elements using 8000000000 bytes Thats about 8GB of data. Do you really have that much virtual memory available? If not, I'd guess that Matlab is actually using a smarter storage scheme (either storing only the diagonal, or even just recognizing an identity matrix as special, or recognizing that it really only needs data for one 1000x1000 identity matrix that can be shared among all your identifiers). What happens if you replace eye() with rand()? Do you still have enough memory to do this operation? jwe ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------