Popups partly not removed from memory.

trostik's Avatar

trostik

30 Jun, 2011 04:21 PM

Hi,

Im working on a project using RL and have a performance issue.
Here is the break down:
1 ) One of the screens dispatches an event
2 ) command called and executes PopUpManager.addPopUp(wnd,contextView,true); and creates a late mediation and a popup shown
3 ) The user finishes the use of the popup and clicks close a close func called on the mediator

PopUpManager.removePopUp(view);
mediatorMap.removeMediator(this);

4 ) The window is closed and all BUT
if i run it in profiler i can clearly see that not all of the objects are disposed.
i have
1 ) Mediator - cleared
2 ) command - cleared
3 ) event - cleared
4 ) view not cleared - (its flex 4 so the view is a "instance" of the component)
5 ) skin - not cleared
6 ) value object - cleared

I have been trying numerous routes to solve this issue with no luck.

Thanks

Alex

  1. Support Staff 2 Posted by Stray on 30 Jun, 2011 07:58 PM

    Stray's Avatar

    Hi Alex, can i just check how long you're waiting for GC before you inspect this?

    Also - does it still happen if you don't mediate the popup?

    Stray

  2. 3 Posted by trostik on 30 Jun, 2011 11:37 PM

    trostik's Avatar

    Hi Stray,

    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.

    The second part i need to run tests on.

    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

    Thanks in advance

    Alex

  3. Support Staff 4 Posted by Stray on 01 Jul, 2011 10:01 AM

    Stray's Avatar

    Hi Alex - can you tell where the references are being held?

  4. 5 Posted by trostik on 02 Jul, 2011 07:33 PM

    trostik's Avatar

    Well the popup is created in the command as a local var of a function - so not there.
    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.

    There is the stylemanager that pairs a view with his skin but i doubt he is envolved with this issue.

    Really out of ideas here...

    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.

    Thank you

    Alex

  5. 6 Posted by trostik on 04 Jul, 2011 07:25 AM

    trostik's Avatar

    Someone?

  6. Support Staff 7 Posted by Till Schneidereit on 04 Jul, 2011 01:12 PM

    Till Schneidereit's Avatar

    Are you creating a local function in the same function you're creating
    the popup in? If so, that would create a closure holding on to the
    popup. In that case, either create the function outside and just
    reference it in the outer function or explicitly null the var
    referencing the popup.

    And yes: You can see references to all live objects in the Flash
    Builder or the FDT profiler. See the respective documentation for
    details.

  7. 8 Posted by trostik on 04 Jul, 2011 01:18 PM

    trostik's Avatar

    Will check the references thing via profiling.THANKS :)

    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?

    Alex

  8. Support Staff 9 Posted by Till Schneidereit on 04 Jul, 2011 01:22 PM

    Till Schneidereit's Avatar

    Right, if you're not creating a local function in that execute method.
    An example for that would be an event handler.

    Other reasons for the popup staying in memory could be event handlers
    added to something outside of the popup from inside it.

    But really, it doesn't sound like the problem is Robotlegs-related, so
    using the profiler is probably your best chance.

  9. 10 Posted by trostik on 04 Jul, 2011 01:34 PM

    trostik's Avatar

    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????

    :) never accused RL just saw some sharp minds around. And asked for help. RL rocks!

  10. Support Staff 11 Posted by Till Schneidereit on 04 Jul, 2011 01:45 PM

    Till Schneidereit's Avatar

    No, having an external reference to an object that you also hold a
    reference to from inside the popup isn't going to be a problem.

    While generally, asking questions that are only loosely related to
    Robotlegs is of course fine, but please understand that we'd very much
    like for people to make it clear when they don't suspect that the
    problem really is related to Robotlegs. For one, it prevents us from
    looking in wrong direction when trying to help you.

  11. Ondina D.F. closed this discussion on 01 Nov, 2011 05:18 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac