Memory Leak in window

13 posts, 0 answers
  1. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 06 Oct 2015 Link to this post

    Hi All

    I'm using kendo ui with angular and I'm having ​some issue with Window closing.

    It seems to leave all sub elements detached DOM trees.

    I found this link so I added a on destroy functionality that traverses all elements and unbind all events empty the html and removes it . 

    I addition I'm running a garbage collector of my own to remove JQuery cache elements manually.

    I'm Attaching a sample code of the problem. to view th issue I used chrome dev tools.

    I took a snapshot before and after the 20 windows were opened and closed and each one appears in the comparison tab as a detached DOM tree.

     

    Any Input will be appreciated.

  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 07 Oct 2015 Link to this post

    Hello Gal,

    The same topic seems to be already discussed in a support ticket of yours. The idea is to destroy the scope in addition to the widget, as suggested by my colleague. In addition, I recommend appending elements before compiling, and fixing the #window-holder vs #window-scope ID inconsistency.

    In case you have additional comments or questions, please use the support ticket, so that the discussion is not forked.

    Regards,
    Dimo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 12 Oct 2015 Link to this post

    Update 

    It turns out that using RoboForm in chrome causes masive memory leak. I opend a ticket with RoboForm and will keep you posted. 

    I use this code to create a numeric grid column with a filter. 

    function columnInteger(field, title, tooltip, click, showText, config, visbleColumn, dataSource, format, showOperators) {
        if (!format) {
            format = "0";
        }
        if (!showOperators && showOperators != false) {
            showOperators = true;
        }
        if (visbleColumn != false) {
            if (!dataSource) {
                dataSource = {};
            }
            var defaults = {
                field: field,
                title: title,
                filterable: {
                    ui: function uiCreateNumericTextBox(element) { element.kendoNumericTextBox({ format: format }); },
                    cell: {
                        showOperators: showOperators,
                        suggestionOperator: "eq",
                        operator: "eq",
                        dataSource: dataSource,
                        template: function cellTemplateCreateNumericTextBox(args) {
                            args.element.kendoNumericTextBox({ format: format });
                        }
                    }
                },
                width: "130px",
                template: "<span name='" + field + "' " + (click ? ' ng-click="' + click + '(dataItem) "' : '') + (showText ? ' ng-show="' + showText + '"' : '') + " title='" + (tooltip ? tooltip : '${' + field + '}') + "'>#=kendo.format('{0:" + format + "}', " + field + ")#</span>"
            };
            return $.extend(true, defaults, config);
        }
        return { title: "", width: "0px", hidden: true };
    }
    It turns out the filter is causing a masive memory leak.

    I replaced the NumericTextBox with a MaskedTextBox and the leak is plugged. 

    function columnInteger(field, title, tooltip, click, showText, config, visbleColumn, dataSource, format, showOperators) {
                if (!format) {
                    format = "0";
                }
                if (!showOperators && showOperators != false) {
                    showOperators = true;
                }
                if (visbleColumn != false) {
                    if (!dataSource) {
                        dataSource = {};
                    }
                    var defaults = {
                        field: field,
                        title: title,
                        filterable: {
                            ui: function uiCreateNumericTextBox(element) { element.kendoNumericTextBox({ format: format }); },
                            cell: {
                                showOperators: showOperators,
                                suggestionOperator: "eq",
                                operator: "eq",
                                dataSource: dataSource,
                                template: function cellTemplateCreateNumericTextBox(args) {
                                            args.element.kendoMaskedTextBox({ mask: "#######" });
      
                                 //args.element.kendoNumericTextBox({ format: format });
                                }
                            }
                        },
                        width: "130px",
                        template: "<span name='" + field + "' " + (click ? ' ng-click="' + click + '(dataItem) "' : '') + (showText ? ' ng-show="' + showText + '"' : '') + " title='" + (tooltip ? tooltip : '${' + field + '}') + "'>#=kendo.format('{0:" + format + "}', " + field + ")#</span>"
                    };
                    return $.extend(true, defaults, config);
                }
                return { title: "", width: "0px", hidden: true };
            }

     

     

  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 13 Oct 2015 Link to this post

    Hello Gal,

    Please do not repost issues on multiple support channels, as they waste support resources and delay answers. As noted in the support thread, we are investigating the NumericTextBox issue.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 13 Oct 2015 Link to this post

    Hello Gal,

    We further investigated the reported issue, but could not find a leak in the NumericTextBox widget. Here is a screencast of the local test (note it is a bit long): The test demos are:
    We will be very thankful if you can point us to the leak issue, if we are missing something.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 13 Oct 2015 Link to this post

    Hi Georgi 

    As I stated in the support ticket related to this forum post the problem is using the NumericTextBox as a filter in Grid causes windows opened to be remain as detached DOM elements. 

    I know this sounds far fetched but I have simulated and made a workaround this issue by replacing the NumericTextbox with a number only MaskedTextBox. 

    Your simulation is creating a NumericTextBox only not in as a grid filter and not opening a window. 

    I have attached the Jing file in my support ticket that demonstrate the issue clearly (the Jing is larger then the size allowed here).

    Here is a Dropbox Link of the Jing. 

    Again please note!

    The problem is the window becomes detached when a NumericTextBox is present in the filter of the grid.  

  8. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 15 Oct 2015 Link to this post

    Hello Gal,

    Thank you for the screencast. I reviewed it and believe that the issue is related to some plug-in that leaks in this case. Could you test you demo in incognito mode?

    I prepared another demo in order to proceed with the investigation. The NumericTextBox is used as a filter row widget and popup window for editing:
    With multiple create/destroy actions, the widgets does not leak: Does this demo leaks at your side? Could you modify it in order to show the leak?

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  9. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 15 Oct 2015 in reply to Georgi Krustev Link to this post

    This leaks in incognito mode ! 

    see attached Jing

  10. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 19 Oct 2015 Link to this post

    Hi Gal,

    thanks for the screencast. Indeed, there seems to be some leaks, which I think are related to the filter-row itself. 

    We will further investigate the case and will post an update here soon.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  11. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 19 Oct 2015 Link to this post

    Hi Gal,

    I would like to inform you that we were able to track and resolve the leaks (mainly in the FilterCell widget). The next internal build will include the fix.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  12. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 19 Oct 2015 Link to this post

    Masive memory leak in sites based on Telerik Kendo UI sites when using Roboform. 

    I'm Pleased to inform you all that Roboform located the memory leak issue and will be fixing it in next release of RF extension.

    this is the response I got from the support team.

     (2015/10/19 05:21 pm EDT) 
    Thank you for report, I confirm the problem. It is caused by a bug in RF.
    It will be fixed in a week (need some testing), in next release of RF extension.
    It will be updated automatically by Google Chrome right after publishing on Google Web Store,
    so you need not reinstall or update RF via installer.
  13. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 21 Oct 2015 in reply to Georgi Krustev Link to this post

    Hi Georgi  

    This memory leak really took its toll on our systems together with the roboform memory leak it became a critical issue.  

    When will it be in an official release ?

    I have production systems using CDN's and don't want to switch them over to a local version.

  14. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 22 Oct 2015 Link to this post

    Hello Gal,
    I am glad that the RoboForm bug was quickly addressed. We will be pushing out an official service pack in about two weeks' time. Please check if the internal build solves all issues in your application to make sure that the service pack CDN will be suitable for your production system.
    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready