[kepler-dev] [Bug 4801] out of memory

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Thu Aug 26 15:24:36 PDT 2010


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4801

--- Comment #9 from Christopher Brooks <cxh at eecs.berkeley.edu> 2010-08-26 15:24:36 PDT ---
Below is some email about a leak worth looking in to.

--start--
Thanks for pointing this out as this is very timely because a bug
report for memory leaks in Kepler was just created.

AddEditorFactory  adds a VisibleParameterEditorFactory named _editorFactory to
parameters that have a _location

The "8.1" test at ptolemy/moml/filter/test/BackwardCompatibility.tcl
illustrates
what the filter does.

        <property name="_location" class="ptolemy.moml.Location" value="355.0,
200.0">
        </property>

becomes

        <property name="_location" class="ptolemy.kernel.util.Location"
value="355.0, 200.0">
        </property>
        <property name="_editorFactory" class="ptolemy.kernel.util.Attribute">
        </property>

(The ptolemy.moml.Location -> ptolemy.kernel.util.Location is done by another
filter.)

One possible solution would be to modify MoMLFilter so that we pass
the parser in as an argument.  MoMLFilter is an interface, so we would need to
modify each of the filters or come up with a backward compatible method.


Another possible solution would be to get the toplevel and see if there
is a _parser attribute, see MoMLParser:

        MoMLParser parser = ParserAttribute.getParser(_toplevel);

        if (parser != this) {
            // Force the parser to be this one.
            ParserAttribute parserAttribute = (ParserAttribute) _toplevel
                    .getAttribute("_parser", ParserAttribute.class);

            if (parserAttribute == null) {
                parserAttribute = new ParserAttribute(_toplevel, "_parser");
            }

            parserAttribute.setParser(this);
        }

However, I believe that _parser is set *after* the parsing is done, so this
might not work.

BTW - Do you have a simple test case for this?

Let me chew on this overnight.  Edward, do you have any insight?

_Christopher


On 7/15/10 8:07 AM, Hudson, Brian R wrote:
> Chris,
>
> Jason Smith and I have spent the past few days trying to chase down why
> our model(s) will not be garbage collected.
>
> It turns out that in our case it is caused by AddEditorFactory.
>
> Under certain conditions AddEditorFactory creates a new static
> MoMLParser that references the model and causesit to never be garbage
> collected. Changing this to non-static alone isn’t enough as an instance
> of AddEditorFactory resides in BackwardsCompatability’s static _filterList.
>
> We’ve worked around the problem for now (by removing AddEditorFactory
> from BackwardCompatability._filterList).
>
> It also looks like the AddIcon filter would cause the same issue, though
> we haven’t encountered this.
>
> Brian
>
--end--

-- 
Configure bugmail: http://bugzilla.ecoinformatics.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the Kepler-dev mailing list