[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory allocation error

From: Sergei Steshenko
Subject: Re: Memory allocation error
Date: Tue, 4 Dec 2012 01:27:28 -0800 (PST)

> From: asha g <address@hidden>
>To: Sergei Steshenko <address@hidden> 
>Cc: "address@hidden" <address@hidden> 
>Sent: Tuesday, December 4, 2012 10:14 AM
>Subject: Re: Memory allocation error 
>>I keep getting this error message when I try to run certain programs. Is 
>>there some way I can increase the memory so this error does not happen. 
>>Thanks Asha G
>>error: memory exhausted or requested size too large for range of Octave's 
>>index type -- trying to return to prompt
>>error: popen2: process creation failed -- Cannot allocate memory
>>error: called from:
>>error:   /usr/share/octave/3.2.3/m/plot/__gnuplot_open_stream__.m at line 28, 
>>column 44
>>error:   /usr/share/octave/3.2.3/m/plot/gnuplot_drawnow.m at line 85, column 
>You don't
show your code.
>I assume the problem occurs when you call some *plot function. If it's the 
>case I suggest to check sizes of the function arguments.
>Your problem begins with
>memory exhausted or requested size too large for range of Octave's index type 
>-- trying to return to prompt
>i.e. you have to find out why "memory [is] exhausted". 
>  Sergei.
> I am attaching the script files. There are many function files. Not sure 
>whether I shd send them or this will do.
>Asha G 

I, of course, cant't tell just looking at files what's wrong.

How much memory does this:

vvvv=zeros(niter,N); abmm = zeros(niter,N); abnn = zeros(niter,N); abhh = 
zeros(niter,N); V= zeros(1,N);alphan = zeros(1,N);

need ?

Anyway, you need to perform basic debugging.

I dislike debuggers in general; in order to find which exactly line chokes the 
script I do the following:
1) I introduce a diagnostic print statement:

fprintf(stderr, "CHECKPOINT 1\n");

2) I copy-paste the statement into several places of the top level script, 
_not_ forgetting to increment '1' above in each copy-paste;

3) I run the top level script and see what's the last CHECKPOINT number printed.

So, if the last one is 'CHECKPOINT 3', the problem occurs obviously between 

In such a manner I pretty quickly narrow down the area to just one line, and 
then investigate what's wrong with that line.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]