[kepler-dev] Memory leak.
Kevin Ruland
kruland at ku.edu
Wed Dec 21 11:34:57 PST 2005
Edward,
I don't fully understand the situation and defer to you or Christopher
for greater details. Perhaps there is something in the Kepler code
which is holding onto a MoMLParser too long.
In kepler there is this code in ActorMetadata.ActorMetadata( InputStream
moml):
{
MoMLParser parser = new MoMLParser();
NamedObj obj = parser.parse( null, moml );
...
}
So in theory the parser should be local and go out of scope.
But in the MoMLParser.parse( URL, Reader ) method, it looks like this is
being held onto. parser returns a variable called _topLevel. But there
is code in the parse() method which assigns this (MoMLParser) to an
attribute of _topLevel called "_parser". I believe this is where the
reference to the MoMLParser is being retained.
Kevin
Edward A. Lee wrote:
> At 12:29 AM 12/21/2005 -0800, Christopher Brooks wrote:
>
>> Yep, this looks like a leak of some sort.
>>
>> In MoMLParser, _parser is declared as:
>> private XmlParser _parser = new XmlParser();
>
>
>
> I'm confused... Wouldn't the leak then actually be
> in the creation of multiple instances of MoMLParser without
> deleting them?
>
More information about the Kepler-dev
mailing list