jQWidgets Forums

jQuery UI Widgets Forums Grid Potential memory leak in jqxGrid ?

This topic contains 9 replies, has 3 voices, and was last updated by  Peter Stoev 9 years, 5 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Potential memory leak in jqxGrid ? #33022

    stephan
    Participant

    Hi,

    Please investigate the following, it might be a memory leak within the jqxGrid code. The “Chrome” memory profiler is giving me strong hints in that direction.

    In “jqxgrid.js” on line 9590 you register an event handler for “selectstart” like this:

                        this.addHandler($(document), 'selectstart.' + this.element.id, function (event) {
    if (self.__drag === true) {
    return false;
    }
    });

    I can not find any place where this event handler gets removed, and indeed Chrome memory profiler insists that it survives “jqxGrid(‘destroy’)”. The problem is that via closure it also prevents other memory from getting garbage collected.

    Regards,
    Stephan

    Potential memory leak in jqxGrid ? #33029

    Peter Stoev
    Keymaster

    Hi Stephan,

    We would look into that and will test whether your report is correct, but we would not discuss the code of jqxGrid and also please keep in mind that sharing a code from our widgets on this Forum or anywhere else is in violation with the EULA.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Potential memory leak in jqxGrid ? #33037

    stephan
    Participant

    Hi Peter,

    Yes, I realised that shortly after posting and I appologise. It was not intentional, I just wanted to make it easier for you to understand the problem that I was trying to describe. We use a lot of public code in our aplication and indeed I forgot that your source code is license protected. Since I can no longer edit my posting, but please feel free to remove the code snippet from my posting.

    On the subject of the memory leakage: by removing the event manually in my own code, before calling “jqxGrid(‘destroy’)”, I can see in the memory profiler that the dangling objects now get garbage collected.

    Regards,
    Stephan

    Potential memory leak in jqxGrid ? #33038

    Peter Stoev
    Keymaster

    Hi Stephan,

    No, problem. I just wanted to mention it. We will test it, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Potential memory leak in jqxGrid ? #79526

    revilo7
    Participant

    Is this issue unattended? I am working with jqwidgets v3.5.0, jquery v1.11.1 in IE11 and Chrome 47 and having the same issue. We are evaluating possible jQuery plugins to design our company’s website. I programmatically unbinded the events and the memory keeps rising with each destroy –> reconstruct

    Potential memory leak in jqxGrid ? #79534

    Peter Stoev
    Keymaster

    Hi revilo7,

    destroy removes all references to jqxGrid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Potential memory leak in jqxGrid ? #79608

    revilo7
    Participant

    Hello Peter;
    I agree with you, I cannot find the widget in the DOM once the ‘destroy’ method is invoked. But I see a significant growth in memory every time I recreate the object.

    Potential memory leak in jqxGrid ? #79609

    Peter Stoev
    Keymaster

    Hi revilo7,

    We don’t know when browser releases its resources.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Potential memory leak in jqxGrid ? #79615

    revilo7
    Participant

    I strongly suggest that your team looks into this as for making the same exercise with other JS plugins our team can’t find an increment in memory usage. Great looks on the widgets and great ease of use but this is a big issue for the site my company wants to design.

    Potential memory leak in jqxGrid ? #79616

    Peter Stoev
    Keymaster

    Hi revilo7,

    We have done that and “destroy” removes the widget from the DOM as well as all references to it. When the browser releases its memory is a matter of the browser’s garbage collector algorithm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.