octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #33458] Repeated load() of the same subfunctio


From: Olaf Till
Subject: [Octave-bug-tracker] [bug #33458] Repeated load() of the same subfunction handles eats up memory
Date: Wed, 01 Jun 2011 20:33:03 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110429 Iceweasel/3.5.16 (like Firefox/3.5.16)

URL:
  <http://savannah.gnu.org/bugs/?33458>

                 Summary: Repeated load() of the same subfunction handles eats
up memory
                 Project: GNU Octave
            Submitted by: i7tiol
            Submitted on: Wed 01 Jun 2011 08:33:02 PM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Other
                  Status: None
             Assigned to: None
         Originator Name: Olaf Till
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Release: stable branch, revision 5bf8af73fc34 of 01/06/2011 17:53

Short description: Consider an m-file function that returns a structure with
function handles to its subfunctions. If the returned structure is save()ed to
a file, each subsequent load() of that file consumes more memory up to
memory-exhaustion.

Repeat by:

Install the attached function "subfunction_handles" in Octaves path. Then:


octave:1> a.b = subfunction_handles ();
octave:2> a.c = 1;


"a.c = 1;", and storing the return value in a structure field instead of
simply as "a = subfunction_handles ();", are only necessary because of bug
#33456. Then:


octave:3> save ("-binary", "testdata.dat", "a")


Now exit and restart Octave. Open a different terminal and from the shell call
the "free" utility to examine memory. Then, again from Octave, do repeatedly


octave:1> load ("testdata.dat")


and after each load(), check memory with "free" from the shell.

With each load(), you see used memory going up by roughly 80MB. To be quite
sure, I proceeded up to exhaustion of RAM and saw growing use of swap.

(BTW if one tries to exit Octave then, this lasts "forever" --- then sending
Octave a SIGTERM makes it crash (glibc reports double free or corruption).)

Some additional notes:

I do know that the re-load()ed subfunction handles can't be used anyway (I
noticed the problem described above load()ing data which _also_ contained
subfunction handles, but they were not used. With this original data, I had
roughly 1GB memory consumption with each load.).

The procedure in "Repeat by" can be varied and a structure with only one of
the returned subfunction handles can be save()ed. Then the memory consumption
is proportionally less, but still present with each (or curiously rather each
second) load(). But even though only one handle is saved in this case, memory
consumption still depends on how many subfunction handles had been returned
before; and I had the impression (did not check thoroughly) that it also
depends on the amount of code in the subfunction bodies.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 01 Jun 2011 08:33:02 PM GMT  Name: subfunction_handles.m  Size: 10kB
  By: i7tiol

<http://savannah.gnu.org/bugs/download.php?file_id=23492>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33458>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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