help-octave
[Top][All Lists]
Advanced

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

octave memory allocation problem ?


From: Ludger Leushacke
Subject: octave memory allocation problem ?
Date: Wed, 19 Apr 95 13:31:14 GMT

Hi all,

There seems to be a memory problem within octave.
Octave claims more and more memory, even if no new variables are created!


This result is from octave-1.1.1 binary distribution running under linux kernel
version 1.2.0 and the slackware 2.1.0 distrib.

Main problem: memory of old variables doesn't get reused. For each assignment
new memory is allocated, the old mem never get free.

Example:
silly m-function halfs the input values:
----------------------------
function h=half(x)

h=x*0.5;
----------------------------

Starting octave and looking at the program size (with ps -l) gives:
$ octave

 F    UID   PID  PPID PRI NI SIZE  RSS WCHAN      STAT TTY   TIME COMMAND
  0   127  2930   164   1  0 2679 1088 189c1f     S    pp2   0:00 octave

octave:1> x=rand(300);

  0   127  2930   164   9  0 3383 1840 189c1f     S    pp2   0:01 octave

octave:2> y1=half(x);

  0   127  2930   164   7  0 4131 2588 189c1f     S    pp2   0:01 octave

octave:3> y2=half(x);

  0   127  2930   164   7  0 4835 3292 189c1f     S    pp2   0:01 octave

octave:4> y1=half(y2);

  0   127  2930   164   9  0 5539 3996 189c1f     S    pp2   0:02 octave

The last statement (4) uses existing variables and therefore the size shoud'nt
increase. Or is this a problem of memory needed within the function body?

The same problem occures with octave-1.1.0 binary for SunOs4.1.1 running
under Solaris 2.3 on a Sparc 20. The memory needed is then:

 F   UID   PID  PPID CP PRI NI   SZ  RSS    WCHAN S TT        TIME COMMAND
 8   127 26522 24779 37  59 20 1179  487 pckt_buf S ?         0:00 octave

 8   127 26522 24779 80   0 20 1357  680 pckt_buf S ?         0:01 octave

 8   127 26522 24779 80  39 20 1554  881 pckt_buf S ?         0:01 octave

 8   127 26522 24779 80  29 20 1730 1057 pckt_buf S ?         0:01 octave

 8   127 26522 24779 80  52 20 1906 1233 pckt_buf S ?         0:01 octave

other values, same effect: memory is increased while not nessecary.

Udo Uschkerat, address@hidden



reply via email to

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