From help-octave-request at bevo dot che dot wisc dot edu Thu Feb 3 04:59:03 2000 Subject: Re: Virtual mem problem From: "Erich Schneider" To: "help-octave at bevo dot che dot wisc dot edu" , "Guest9" Date: Thu, 03 Feb 00 12:08:55 On Thu, 3 Feb 2000 11:01:47 +1300, Guest9 wrote: >(C:\octave\bin\octave.bin 1017) commit_and_inc: VirtualAlloc failed >error: memory exhausted -- trying to return to prompt Depending on what operations I did before I often get this error on Linux (2.0.14) and OS/2 (2.0.13), too (both with enough memory). At certain points e.g. a=ones(1000,1) isn't possible any more, although e.g. a=ones(100,10) works fine. At the moment I don't have an exact description of the problem at hand (sorry). However, based on my sporadic observations I too have the impression that octave's memory allocation doesn't work correctly. This problem has been observed by Daniel Heiserer, too: On Wed, 02 Feb 2000 13:08:55 +0100, Daniel Heiserer wrote: >jwe at bevo dot che dot wisc dot edu wrote: >> >> 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 If a more detailed protocol of such an error occurance is needed, I can try to reproduce this behaviour. Just an additional comment on the following code: >here's part of my script: > >clear; >load f5hs3.txt >load f5ls3.txt >s=size(f5hs3); >sum=0; >x=0; >C=-636.73*(f5hs3-f5ls3)./f5ls3-0.079098*f5hs3+332.15; >for i=1:s(1,1)/2 > for j=1:s(1,2)/2 > if f5hs3(2*i,2*j)<3400 > sum=sum+C(2*i,2*j); > x=x+1; > endif > endfor >endfor >average=sum/x; Coded this way, you waste a lot of the power of octave. Since octave is a matrix oriented language you can do better with: [m,n]=size(f5hs3); C_temp = C(2:2:m,2:2:n); C_temp = C_temp(:); %or reshape average=mean(C_temp(find(f5hs3(2:2:m,2:2:n)<3400))); ---------------------------------------------------------------------- Erich Schneider, Dipl.-Phys. | eschneider at nefo dot med dot uni-muenchen dot de Neurologische Forschung | u7x31ay at lrz-muenchen dot de Ludwig-Maximilians-Universit"at | Klinikum Grosshadern, M"unchen | Fax: +49,89,70906,101 ----------------------------------------------------------------------- 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 -----------------------------------------------------------------------