1. #1
    Sencha User cyChop's Avatar
    Join Date
    Jun 2010
    Location
    Metz, France
    Posts
    59
    Vote Rating
    0
    cyChop is on a distinguished road

      0  

    Default Question: GXT and memory

    Question: GXT and memory


    Hi there,

    I was just wondering how JS compiled with GXT is managed in memory by the browser?

    I ran some tests in Chromium with ProcessExplorer, creating an object and then deleting all references to it, doing it in a loop, and I got a nice ramp. Aren't objects supposed to be deleted from memory when they're not referenced anymore?

    I'm concerned this might lead to memory leaks in large multi-screen applications, but again, this is a mere question, I'm just trying to understand how it works...

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    We are using the GWT detach/attach model to remove all event listener again. Where do you have a leak? Are you using a widget?

  3. #3
    Sencha User cyChop's Avatar
    Join Date
    Jun 2010
    Location
    Metz, France
    Posts
    59
    Vote Rating
    0
    cyChop is on a distinguished road

      0  

    Default


    It was just a brutal trial creating a widget, never attaching it and destroying the reference.

    I am under the impression that objects which are created are never destroyed, but I hadn't time to run a thorough test yet. We plan to use a scripting tool to automate navigation in our application and see how it will react. I'll know better then...

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Destroying the reference, means set it to null? We are not doing anything with these (we cannot) and the GWT compiler isnt doing anything either.

    The garbage collector of the browser should take care of this, as long as the widget is not attached and not referenced anywhere else.

  5. #5
    Sencha User cyChop's Avatar
    Join Date
    Jun 2010
    Location
    Metz, France
    Posts
    59
    Vote Rating
    0
    cyChop is on a distinguished road

      0  

    Default


    Yes, I set the pointer to null. In Java, this means the object is eligible for garbage collection.

    Java is my only referential, since my knowledge of JavaScript is very limited. Thanks for your help, sven!

Similar Threads

  1. memory/performance question
    By gimler in forum Community Discussion
    Replies: 1
    Last Post: 30 Jan 2008, 11:31 AM
  2. Memory Usage Question
    By mglaser in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 27 Oct 2007, 11:22 PM
  3. A question about memory usage
    By garyng in forum Community Discussion
    Replies: 37
    Last Post: 24 Apr 2007, 6:36 AM

Thread Participants: 1