help-octave
[Top][All Lists]
Advanced

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

Memory....


From: Stef Pillaert BK
Subject: Memory....
Date: Fri, 29 Aug 1997 16:07:31 +0000 (MET)

Hello,

I've written a program where I use a lot of big matrices.
The program is a big function, where I call a lot of other functions, like
this:

function retval=program(....)
  function1(...);
  function2(...);
  ....
  function12(...);
endfunction

Each of those functions call a lot of other functions, with a lot of
loops.

At a certain stage, I run out of memory, and the program halts. Indeed,
when I follow what's happening (using Linux "top") , I can see that the
"Size" is growing and growing, and at the end becoming too big for the
available memory....

However, when I change my program to:

function retval=program(...)
  function1(...);
  function2(...);
  ....
  save file1 *;
  function12(...);
endfunction

this is what happens: the program halts (of course), but using the "save
*" I saved all (?) variables. Then I quit octave, I restart octave, I load
file1, and I execute function12 without any problem! "Size" (using top) is
also a lot smaller (about 50%).

Is this behaviour by octave normal (I'm not sure about the "save *": does
it save everything? I suppose there is an amount of memory taken by the
functions I call, but can it be that much?). Can I do some other checking
to find out what I'm doing wrong? It's very hard for me to trace down
what's going on, because the results I get from the program are quite
OK, so... Also the file1 seems to have everything I expect it to
have. Has this something to do with precision used with save and load?

(I'm not using any recursion, and I'm not using loops like this (any
more..):

retval=[]
for i=1:times
  retval=[retval;some_matrix];
endfor

I do call the same functions over and over again, I use a lot of "eval" (I
know it's slowing down things, but I have my reasons for this)).

If you think you can help me, thanks very much.

Stef.





reply via email to

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