Project

General

Profile

Actions

Bug #7190

closed

memory leak due to hierarchy listeners when cloning

Added by Daniel Crawl over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
-
Start date:
05/11/2017
Due date:
% Done:

0%

Estimated time:
Spent time:
Bugzilla-Id:

Description

When a model is cloned, some NamedObjs in the new model have hierarchy listeners from the original model, which prevents the new model from being garbage collected.

In the usecase I'm debugging, the toplevel Composites in both the original and new models are added as hierarchy listeners to PortParameters, but only the toplevel in the new model should be added. The original toplevel is added since clone() and setContainer() are called for the PortParameter before its container actor has been moved to the new toplevel.

I don't know the best approach to fix this. Making the listeners weak references would fix the memory leaks, but wrong listeners would still receive hierarchy change events.


Files

leak.java (691 Bytes) leak.java Daniel Crawl, 05/12/2017 05:42 PM
leakConst.java (713 Bytes) leakConst.java Christopher Brooks, 05/17/2017 05:27 PM
Screen Shot 2017-05-17 at 3.03.05 PM.png (268 KB) Screen Shot 2017-05-17 at 3.03.05 PM.png jvisualVm showing leak class with Ramp Christopher Brooks, 05/17/2017 05:36 PM
Actions

Also available in: Atom PDF