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
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
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
};
}
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
};
}
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
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
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.
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
This leaks in incognito mode !
see attached Jing
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
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
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.
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.
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