bugGnash - The GNU Flash player - Bugs: bug #21825, external movies are not unloaded

 
 

bug #21825: external movies are not unloaded

Submitted by:  Udo Giacomozzi <udog>
Submitted on:  Tue 18 Dec 2007 08:44:29 AM UTC  
 
Category: coreSeverity: 3 - Normal
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 23 Jan 2008 01:54:30 PM UTC, comment #10:

Seems to work. Closing, in the absence of complaints so far.

Benjamin Wolsey <bwy>
Project Member
Tue 08 Jan 2008 09:05:01 PM UTC, comment #9:

Thank you, committed use of it. Tests welcome.

Sandro Santilli <strk>
Project Member
Tue 08 Jan 2008 05:33:47 PM UTC, comment #8:

I'm aware of this, and added getMovieLibraryLimit() to gnashrc a while ago. It just needs to be used with set_limit() on the media library once the RcFile is constructed.

Benjamin Wolsey <bwy>
Project Member
Tue 08 Jan 2008 05:14:40 PM UTC, comment #7:

Added bwy in Cc, being a gnashrc hacker recently :)

Sandro Santilli <strk>
Project Member
Tue 18 Dec 2007 12:37:47 PM UTC, comment #6:

Done and committed. The media library now defaults to a maximum of 8 items. The value is configurable at any time by calling set_limit().

Making this limit user-configurable seems a very good idea to me, but I could not implement it yet (anyone?).

=== Maybe wiki headers need to be activated ===

Udo Giacomozzi <udog>
Project Member
Tue 18 Dec 2007 11:03:30 AM UTC, comment #5:

Thanks. Eventually, keep it open to fetch max cache size from RcInitFile.

===Why can't I use the wiki headers (or can I?)===

Sandro Santilli <strk>
Project Member
Tue 18 Dec 2007 11:01:17 AM UTC, comment #4:

Yes, disabling line server/impl.cpp:762 keeps memory usage constant and the movie still works.

Now, I understand the "library" is some kind of cache. However, a cache usually does not exceed some predefined size.

I'll try to extend the MovieLibrary class to keep track of cache hits and limit it's size.

Udo Giacomozzi <udog>
Project Member
Tue 18 Dec 2007 10:08:25 AM UTC, comment #3:

Supposedly things should go fine limiting library size by arbitrary value, try 0 (never keep defs alive) for a good test of robustness.

Then cross your fingers and hope ref counting survive.

=== What if it works ? ===

Well, if that works maybe we might have a compile-time define to speicify the limit and cleanup by a oldst-instntiated basis.

Sandro Santilli <strk>
Project Member
Tue 18 Dec 2007 09:46:05 AM UTC, comment #2:

Any way to fix that?

(Headers: use Wiki markups, ie. three "=" in a row)

Udo Giacomozzi <udog>
Project Member
Tue 18 Dec 2007 09:23:33 AM UTC, comment #1:

Exactly, the library is never cleaned up.

BTW, how did you make those nice headers in your comment ?

Sandro Santilli <strk>
Project Member
Tue 18 Dec 2007 08:44:29 AM UTC, original submission:

External .SWF files loaded with loadMovie() are kept in memory forever, even if there is no instance of them left.

Judging from the message "Movie XXXXX (SWF6) added to library" I guess that freeing objects from that "library" is not implemented. I didn't look at the code, though.

Testcase

Save the two attached files to a directory, "cd" into it and start this command (all in one line):

x=0 ; while [ $x -lt 100 ]; do x=$(expr $x + 1) ; echo $x ; cp bitmap-movie.swf bitmap-movie-$x.swf ; done

This will generate 100 copies of the file "bitmap-movie.swf", which is necessary because Gnash will load a single file only once into the "library".

Then start gnash playing "bitmap-movie-loader.swf" and watch it's memory usage which will quickly increase.

ActionScript used in the loader movie

list = new Array();
depth = 1;

this.onEnterFrame = function() {

depth++;
var foo = _root.createEmptyMovieClip("foo"+depth, depth);
foo.loadMovie("bitmap-movie-"+depth+".swf");
foo._x = (depth % 10) * 10;
foo._y = foo._x;

list.push(foo);

if (list.length > 5) {
foo = list.shift();
foo.removeMovieClip();
}

}

Description: Loads one .swf file in each frame. Once 5 movies are visible, the oldest is being removed and it's definition could be freed (but isn't apparently).

Udo Giacomozzi <udog>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #14650:  bitmap-movie.swf added by udog (140KiB - application/x-shockwave-flash)
file #14651:  bitmap-movie-loader.swf added by udog (306B - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bwy (Posted a comment)
  • -unavailable- added by strk (in case you want to do some more gnashrc...)
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by udog (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Jan 2008 01:54:30 PM UTCbwyStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 08 Jan 2008 05:13:45 PM UTCstrkCarbon-Copy-=>Added bwy
    Tue 18 Dec 2007 12:37:47 PM UTCudogStatusIn Progress=>Ready For Test
      Assigned toudog=>None
    Tue 18 Dec 2007 11:03:30 AM UTCstrkStatusNone=>In Progress
      Assigned toNone=>udog
    Tue 18 Dec 2007 08:44:29 AM UTCudogAttached File-=>Added bitmap-movie.swf, #14650
      Attached File-=>Added bitmap-movie-loader.swf, #14651

    Back to the top


    Powered by Savane 3.1-cleanup1