Have some great and some 'bad' news:

great: the big memory problems of labels are gone
'bad': My claim that ui.core.Widgets have no memory-problem from the last 
post was wrong.
This was from a test, where widgets were created and destroyed instantly, 
without adding them to the root.

My current measures are as follows (done on windows xp sp2, IE7), I did 
all the measures with a new testclass now (attached below).
All widgets/elements are made visible in the DOM and then removed again.

----------------
qooxdoo beta 1
----------------
 10.000 qx.ui.core.Widgets: 40MB leak
  3.000 qx.ui.basic.labels: stopped test, because massive memory leak

------------------
trunk (rev 15821)
------------------

  10.000 qx.ui.core.Widgets: 40MB leak
  10.000 qx.ui.basic.Labels  40MB leak

 100.000 qx.html.Labels:      7MB leak 

------------------
trunk (rev 15821)
------------------
 changed, so that objects are not stored in object-registry

 100.000 qx.html.Labels:      no leak     <- as I said - 7MB on 100.000 
elements without this fix is not relevant for now


--------------- test source --------
/**
 * Label-Creator
 */
qx.Class.define("custom.Application",
{
  extend : qx.application.Standalone,

  members :
  {
    map : new Array(),
    htmlRootElement : null, 
    offset : 0,
    masterLabel : null, 
 
    testHTMLElement: function() {
      var popped;
      while (popped=this.map.pop()) {
        popped.dispose();
        popped=null;
      }

      for ( var i = 0; i < 500; i++) { 
        var qxElement = new qx.html.Label;
        qxElement.setContent(this.offset + "Test");
 
        this.htmlRootElement.add(qxElement);
 
        this.map.push(qxElement);
        this.offset++;
      } 

      this.masterLabel.setContent("Widget Count: "+this.offset);
      qx.event.Timer.once(this.testHTMLElement, this, 300);
    },
 
    testWidgets: function() {
      var popped;
      while (popped=this.map.pop()) {
        popped.destroy();
        popped=null;
      }
 
      for ( var i = 0; i < 100; i++) {
 
        // toggle comment to switch between Labels and widgets 
        var label=new qx.ui.basic.Label(this.offset + "Test");
        //var label=new qx.ui.core.Widget();
        //label.getContentElement().setAttribute("text", this.offset + 
"Test");
 
        this.getRoot().add(label, {
          left : 50,
          top : 50 + i*20
        }); 
 
        this.map.push(label);
 
        this.offset++;
      }
 
      this.masterLabel.setContent("Widget Count: "+this.offset);
      qx.event.Timer.once(this.testWidgets, this, 300);
    },
 
 
    main : function()
    {
      // Call super class
      this.base(arguments);
      this.masterLabel=new qx.ui.basic.Label();
      this.getRoot().add(this.masterLabel, {
        left : 200,
        top : 10
      }); 
 
      var body=qx.dom.Node.getBodyElement(document);
      this.htmlRootElement= new qx.html.Root(body);
 
      // toggle comment for different tests
      this.testHTMLElement();
      //this.testWidgets();
    }
  }
});


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to