This is a migrated thread and some comments may be shown as answers.

Memory Leak in window

12 Answers 267 Views
Window
This is a migrated thread and some comments may be shown as answers.
Gal
Top achievements
Rank 2
Gal asked on 06 Oct 2015, 07:08 AM

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.

12 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 07 Oct 2015, 03:19 PM
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!
 
0
Gal
Top achievements
Rank 2
answered on 12 Oct 2015, 05:26 PM

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 };
        }

 

 

0
Alex Gyoshev
Telerik team
answered on 13 Oct 2015, 08:06 AM

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!
 
0
Georgi Krustev
Telerik team
answered on 13 Oct 2015, 02:27 PM
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!
 
0
Gal
Top achievements
Rank 2
answered on 13 Oct 2015, 04:05 PM

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.  

0
Georgi Krustev
Telerik team
answered on 15 Oct 2015, 12:04 PM
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!
 
0
Gal
Top achievements
Rank 2
answered on 15 Oct 2015, 12:28 PM

This leaks in incognito mode ! 

see attached Jing

0
Georgi Krustev
Telerik team
answered on 19 Oct 2015, 11:33 AM
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!
 
0
Georgi Krustev
Telerik team
answered on 19 Oct 2015, 02:07 PM
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!
 
0
Gal
Top achievements
Rank 2
answered on 20 Oct 2015, 04:11 AM

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.
0
Gal
Top achievements
Rank 2
answered on 21 Oct 2015, 07:36 AM

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.

0
Alex Gyoshev
Telerik team
answered on 22 Oct 2015, 08:18 AM
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!
 
Tags
Window
Asked by
Gal
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Gal
Top achievements
Rank 2
Alex Gyoshev
Telerik team
Georgi Krustev
Telerik team
Share this question
or