Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • wing.t.lee
    replied
    Dear support,

    I have repeat the same test "to repeat a function with open tab and close tab" and now we use the SmartGWT Showcase public site, in firefox 24.3.0 and loop for over 10000 times.

    http://www.smartclient.com/smartgwt/...abs_add_remove


    I get find the following
    1. I find over 10000 null content isc_Tab_XXXX objects accumulated without clean (see attached image)
    2. in Task Manager, I find firefox.exe growth from ~250M to 705M without any memory release
    3. about memory grow to 147M for smartgwt showcase, and I also find some detached memory from smartgwt ~18M

    Which get the same sympton as my application. The main different is my memory usage inside the Tab is larger, so I meet the slow response on my application in quicker time...

    So we want to ask is the memory leakage or object leakage caused by SmartGWT framework? Is there any patch in SmartGWT that can fix this?
    Attached Files
    Last edited by wing.t.lee; 12 Feb 2015, 22:21.

    Leave a comment:


  • wing.t.lee
    replied
    Hi

    I try to repeat a function for over 200 times and I find that from FireBug DOM tab

    1. the object with content is keep the same without out accumulate
    2. but for those object with null content (should be destroy as mentioned in the previous post) is accumulated, for example there are over 2000 TextItem, and 200 ValuesManager objects (although all content null)
    3. And I find the performance of this same function is significant degrade from 2-3 seconds to 8-10 seconds when 200 times.
    4. From Task Manager that memory usage of Firefox.exe grow from 250M to 720M
    5. per attached image and we find the about:memory it grow from 29M to 166M, and I also find 40M detached. Nearly no memory release after clicking the GC button (see images for screen cap of about:memory after 200 times ...)

    I guess the slow response (point 3) would be caused by the accumulated null isc_ objects. So I want to know any method I can identify the null object and clean it? How can I prevent the accumulate null isc_ object?
    Attached Files
    Last edited by wing.t.lee; 12 Feb 2015, 03:38.

    Leave a comment:


  • Isomorphic
    replied
    Again, the presence of these null references does not indicate a leak. The fact that those variables are null means the objects are no longer referenced from global scope, which is a good thing, because it means they can be garbage collected.

    The Developer Console cannot tell you if you have a bug in your code where you are still holding on to some other reference to these widgets, which would cause a leak. For this, you need to use standard debugging techniques. You haven't shared runnable code with us, so at the moment, we can't help with this.

    instead of worrying further about those null variables, please take the steps we've been recommending:

    1. Tell us whether the ResultSets you see in the "window" object that are non-null have "cacheAllData" in their toString() result

    2. Retest for a leak with the new build, again testing for memory exhaustion, not just memory increase (memory increase means nothing at all unless you can show memory exhaustion)

    Leave a comment:


  • wing.t.lee
    replied
    Originally posted by Isomorphic View Post
    If you see a global variable with value = null, that object has been successfully destroy()d and will be garbage (unless your code holds onto another reference to it, as with any object).

    Per further check and continue using, I still find "null value" global variables accumulated including isc_ValuesManager, isc_ResultSet, isc_TextItem, .... and the memory usage is still going up.

    As mentioned in quote that it is possible the variable is "holds onto another reference to it, as with any object". How can I check it out in Development Console?

    Leave a comment:


  • Isomorphic
    replied
    If you see a global variable with value = null, that object has been successfully destroy()d and will be garbage (unless your code holds onto another reference to it, as with any object).

    Objects cannot be added to two parents, as Blama stated. Attempting to add the object to a new parent automatically removes it from the old.

    You may be getting the error message you were seeing before because a widget has been destroy()d and then you try to add it to a new parent.

    Leave a comment:


  • wing.t.lee
    replied
    To Blama,

    As I find in the code (from my teammate) that they have addMember a TabSet to a Section at the beginning of the method, and than addMember the same TabSet object onto another VLayout. So when I call destroy the Section after destory of Layout, the WARNING message is occur...

    Leave a comment:


  • Blama
    replied
    Hi wing.t.lee,

    Originally posted by wing.t.lee View Post
    As I find the objects is associated to two parents and when object is being by second parent, (since the first parent is already destory before) and cause error...
    I don't think that this is allowed. For example, if I remember correctly, it is disallowed to use a ListGridField instance in more than one ListGrid.

    Best regards,
    Blama

    Leave a comment:


  • wing.t.lee
    replied
    Thx again Isomorphic and the answer is very useful, per checking and I find that it would be case 1 as you mention

    You might be trying to call destroy() on an object which is already destroyed.
    As I find the objects is associated to two parents and when object is being by second parent, (since the first parent is already destory before) and cause error...


    But per further checking vs Firebug on some objects isc_ValuesManager_XX and find most of the old objects in still there but value = null, I want to know whether it is waiting for GC? or not yet destroy, please see the attached image for the screen capture of firebug DOM...

    Do you know any hint on destroy this object?
    Also how can I check the size of object still in the DOM tree in Development Console...?
    Attached Files

    Leave a comment:


  • Isomorphic
    replied
    Originally posted by wing.t.lee View Post
    I cannot see "(cacheAllData fetch)" when I dump the element list in SC DevConsole log.
    Call toString() on these ResultSets to see whether (cacheAllData fetch) appears in the description.

    Since the isc_ResultSet_XXX objects the number is dynamically assign at runtime, so I cannot match with my code. that's why I want to see whether have method to render the data at runtime...
    We have no idea what you mean by a "method to render the data at runtime".

    About the error message you are seeing, this generally indicates a usage error. Some possibilities:

    1. You might be trying to call destroy() on an object which is already destroyed.

    2. You might be calling undocumented internal methods such as BaseWidget.create() or doInit(), which would interfere with the component lifecycle - don't call undocumented methods

    3. You might be using Component XML or a mixture of direct SmartClient JavaScript code with SmartGWT via JSNI - let us know if you are doing anything like this

    Leave a comment:


  • wing.t.lee
    replied
    I try to add some SC.logInfo at destroy method for a TabSet class,

    I find that the destroy method is called but "MySearchTabSet- destroy", but followed with the WARNmessage "Instantiating in SGWT a properties object from the SmartClient side may lead to undefined behavior if the SmartClient Framework is expecting to perform the instantiation itself."

    And per checking with DevConsole Watch Tab, I still can see that component in the tree... Also, when I right click and destroy by DevConsole, it show the same message in the log ...

    Do you know why I cannot destroy "MySearchTabSet" this object...


    Code:
    19:41:07.189:TMR9:INFO:Log:MySearchTabSet- destroy
    19:41:07.190:TMR9:WARN:Log:Instantiating in SGWT a properties object from the SmartClient side may lead to undefined behavior if the SmartClient Framework is expecting to perform the instantiation itself.

    Leave a comment:


  • wing.t.lee
    replied
    I cannot see "(cacheAllData fetch)" when I dump the element list in SC DevConsole log.

    Since the isc_ResultSet_XXX objects the number is dynamically assign at runtime, so I cannot match with my code. that's why I want to see whether have method to render the data at runtime...

    Leave a comment:


  • Isomorphic
    replied
    If you look at any of the isc_ResultSet_XXX objects that seem to be leaked, what is the componentId listed there?

    If it says "(cacheAllData fetch)", then that was indeed a genuine leak, and we've just fixed it for builds dated February 5 and later.

    If not, let us know what componentIds you *do* see against those resultSet instances.

    Leave a comment:


  • wing.t.lee
    replied
    Thx Isomorphic reply,

    and

    1. DataSources are not Canvases so they do not contribute to the Canvas count. The list of globals previously discussed (isc.getKeys(window)) would reveal leaked DataSources.
    for answer 1: we use the isc.getKeys to print out the leakage component at runtime. So I cannot place any code immediate even I find particular isc_ResultSet_XXXX. So do you know any tool in SmartGWT that can make the ResultSet visible? So that I can identify and fix the leakage quickly?

    2. I try to go to "Watch" tab in DevConsole, select an item such as ListGrid object or VLayout, right click and I find a function call "Destroy". And I try to destory the components one by one, I find that the component disappear immediately in my client browser. but I cannot see any free up of memory even I force GC in about:memory of Firefox. So my question is
    2a. is the Destory function in DevConsole same as Java API call in SmartGWT?
    2b. why I cannot see any change of memory (after GC) when I destory object by Dev Console?
    for answer 2: I have already tried to click GC in about:memory as well as to wait for over 15 minutes but still cannot get the memory free up in Firefox after I click destroy? so can I treat this as "the destroy() of object is called but the destroy action not effective and cannot free up memory after call?" Or some other reason that I can prove the object is already destroied?

    Leave a comment:


  • Isomorphic
    replied
    1. DataSources are not Canvases so they do not contribute to the Canvas count. The list of globals previously discussed (isc.getKeys(window)) would reveal leaked DataSources.

    2 a) yes b) as previously discussed, browsers do not immediately release memory

    3. No, and if there was, there's no reason to think it would help. Browsers do not maintain a separate, fixed-size pool for DOM objects, when they run out of memory, they have run out of all memory.

    4. When you simply toString() a ResultSet, it shows you the component that created it, if it was automatically created by a widget, such as a ListGrid. However, ResultSets are also auto-created by DataSources when using the cacheAllData or autoCacheAllData settings - are you using these settings?

    Leave a comment:


  • wing.t.lee
    replied
    Per further checking vs DevConsole and find the following question

    1. I cannot find the leakage due to DataSource by Dev Console? or some count (like Canvas count) can show the leakage of DataSource?

    2. I try to go to "Watch" tab in DevConsole, select an item such as ListGrid object or VLayout, right click and I find a function call "Destroy". And I try to destory the components one by one, I find that the component disappear immediately in my client browser. but I cannot see any free up of memory even I force GC in about:memory of Firefox. So my question is
    2a. is the Destory function in DevConsole same as Java API call in SmartGWT?
    2b. why I cannot see any change of memory (after GC) when I destory object by Dev Console?

    3. For short term case, is there any configure in Firefox that we can allocate more memory for DOM tree in client side?

    4. Per dumping of all object by isc.getKeys(), I find many leakage object "isc_ResultSet_XXX", by what way I can find the content of ResultSet object so that we can explicitly identify which part cause the ResultSet leakage? Can DevConsole help on this? is it reflected in canvas or some other count in the tool?
    Last edited by wing.t.lee; 3 Feb 2015, 16:47.

    Leave a comment:

Working...
X