bugGNU Octave - Bugs: bug #33458, Repeated load() of the same...

 
 

bug #33458: Repeated load() of the same subfunction handles eats up memory

Submitter:  Olaf Till <i7tiol>
Submitted:  Wed 01 Jun 2011 08:33:02 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Olaf Till Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 03 Jan 2014 04:52:52 PM UTC, comment #3: 

This does seem to have been fixed somewhere along the way.  Closing report.

Rik <rik5>
Group administrator
Fri 03 Jan 2014 04:12:24 PM UTC, comment #2: 

I don't see this problem with 3.8.0.  I put the load command in an infinite loop and watched with top and didn't see the octave process growing.  Could someone confirm and close this report?

John W. Eaton <jwe>
Group administrator
Wed 26 Sep 2012 03:34:33 PM UTC, comment #1: 

This is still a problem on the development branch (9/26/2012).

Rik <rik5>
Group administrator
Wed 01 Jun 2011 08:33:02 PM UTC, original submission:  

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.

Olaf Till <i7tiol>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #23492:  subfunction_handles.m added by i7tiol (10KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by i7tiol (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-03 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2012-09-26 rik5 StatusNone Confirmed
    2011-06-01 i7tiol Attached File- Added subfunction_handles.m, #23492

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code