tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/338-popups-partly-not-removed-from-memoryRobotlegs: Discussion 2013-04-28T09:55:25Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-06-30T16:21:42Z2011-06-30T16:21:44ZPopups partly not removed from memory.<div><p>Hi,</p>
<p>Im working on a project using RL and have a performance
issue.<br>
Here is the break down:<br>
1 ) One of the screens dispatches an event<br>
2 ) command called and executes
PopUpManager.addPopUp(wnd,contextView,true); and creates a late
mediation and a popup shown<br>
3 ) The user finishes the use of the popup and clicks close a close
func called on the mediator</p>
<pre>
<code>PopUpManager.removePopUp(view);
mediatorMap.removeMediator(this);</code>
</pre>
<p>4 ) The window is closed and all BUT<br>
if i run it in profiler i can clearly see that not all of the
objects are disposed.<br>
i have<br>
1 ) Mediator - cleared<br>
2 ) command - cleared<br>
3 ) event - cleared<br>
4 ) view not cleared - (its flex 4 so the view is a "instance" of
the component)<br>
5 ) skin - not cleared<br>
6 ) value object - cleared</p>
<p>I have been trying numerous routes to solve this issue with no
luck.</p>
<p>Thanks</p>
<p>Alex</p></div>trostiktag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-06-30T19:58:06Z2011-06-30T19:58:06ZPopups partly not removed from memory.<div><p>Hi Alex, can i just check how long you're waiting for GC before
you inspect this?</p>
<p>Also - does it still happen if you don't mediate the popup?</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-06-30T23:37:41Z2011-06-30T23:37:42ZPopups partly not removed from memory.<div><p>Hi Stray,</p>
<p>As im using profiler im clicking on the run GC button after i
already have more than three cumulative instances of the skin and
component in the heap.</p>
<p>The second part i need to run tests on.</p>
<p>One more thing is , im not pointing a finger at RL it very well
might be something that i dont yet know or a glitch in the SDK
etc</p>
<p>Thanks in advance</p>
<p>Alex</p></div>trostiktag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-01T10:01:44Z2011-07-01T10:01:44ZPopups partly not removed from memory.<div><p>Hi Alex - can you tell where the references are being held?</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-02T19:33:16Z2011-07-02T19:33:16ZPopups partly not removed from memory.<div><p>Well the popup is created in the command as a local var of a
function - so not there.<br>
And closed in a mediator - but is the mediator is cleared out of
the heap the things he points to should be removed as well.</p>
<p>There is the stylemanager that pairs a view with his skin but i
doubt he is envolved with this issue.</p>
<p>Really out of ideas here...</p>
<p>Is there a way to check out references of an object that is
allocated in the memory in a given time? This kind of a trick could
really give us some clues.</p>
<p>Thank you</p>
<p>Alex</p></div>trostiktag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-04T07:25:52Z2011-07-04T07:25:52ZPopups partly not removed from memory.<div><p>Someone?</p></div>trostiktag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-04T13:12:17Z2011-07-04T13:12:17ZPopups partly not removed from memory.<div><p>Are you creating a local function in the same function you're
creating<br>
the popup in? If so, that would create a closure holding on to
the<br>
popup. In that case, either create the function outside and
just<br>
reference it in the outer function or explicitly null the var<br>
referencing the popup.</p>
<p>And yes: You can see references to all live objects in the
Flash<br>
Builder or the FDT profiler. See the respective documentation
for<br>
details.</p></div>Till Schneidereittag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-04T13:18:27Z2011-07-04T13:18:27ZPopups partly not removed from memory.<div><p>Will check the references thing via profiling.THANKS :)</p>
<p>About the local function : Im creating and adding the popup at
"execute" of a command as a local var cause i need it to initiate a
mediator based on that view. But the var is local to a function
that gets cleared after the command does his thing. So no
references should be present there. Wrong?</p>
<p>Alex</p></div>trostiktag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-04T13:22:19Z2011-07-04T13:22:19ZPopups partly not removed from memory.<div><p>Right, if you're not creating a local function in that execute
method.<br>
An example for that would be an event handler.</p>
<p>Other reasons for the popup staying in memory could be event
handlers<br>
added to something outside of the popup from inside it.</p>
<p>But really, it doesn't sound like the problem is
Robotlegs-related, so<br>
using the profiler is probably your best chance.</p></div>Till Schneidereittag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-04T13:34:33Z2011-07-04T13:34:33ZPopups partly not removed from memory.<div><p>Didn't checked it yet but... might it be that the model is
holding a "pointer" to a same object that the component got as a
data????</p>
<p>:) never accused RL just saw some sharp minds around. And asked
for help. RL rocks!</p></div>trostiktag:robotlegs.tenderapp.com,2009-10-18:Comment/82915422011-07-04T13:45:34Z2011-07-04T13:45:34ZPopups partly not removed from memory.<div><p>No, having an external reference to an object that you also hold
a<br>
reference to from inside the popup isn't going to be a problem.</p>
<p>While generally, asking questions that are only loosely related
to<br>
Robotlegs is of course fine, but please understand that we'd very
much<br>
like for people to make it clear when they don't suspect that
the<br>
problem really is related to Robotlegs. For one, it prevents us
from<br>
looking in wrong direction when trying to help you.</p></div>Till Schneidereit