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

Memory Leaks still exists

7 Answers 135 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 2
Markus asked on 23 Apr 2013, 08:54 AM
Hello everybody,

referring to the thread: http://www.kendoui.com/forums/dataviz/general-discussions/memory-leaks.aspx#2490157 we perfomed updates of kendoUI and jQuery. Unfortunately problem still exists after updating. 

We spent a lot of time figuring out the cause. As you can see in the attached screenshot the Shapes and Ovals in the DataViz remain present in the DOM. Perhaps this isnĀ“t new to you. Nevertheless we need a solution as soon as possible.

I attached a screenshot where you can see the memory leak. 

You can easly reproduce this behaviour using this test scenario:
http://www.kendoui.com/forums/dataviz/general-discussions/memory-leaks.aspx#z8TQWdQYx0-1SLF-SWApjA .

Feel free to contact me.

Regards,
Markus.




7 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 23 Apr 2013, 11:28 AM
Hi,

What version of IE are you using in the test? The leaking elements are VML and it's not officially supported in IE 8 and above. The implementation that exists in quirks mode is known to be slow and buggy.

I recommend you to try the test in standards mode where the Chart will use SVG in IE 9 and above (attached). The difference in performance and memory usage is quite dramatic.

I hope this helps.

Regards,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Markus
Top achievements
Rank 2
answered on 23 Apr 2013, 11:43 AM
Hi,

you can reproduce this leaking bug in every browser - it's not only an IE problem. We tested this issue with IE 9, Firefox and Chrome as well.
If you have a look at the Google Chrome Profile Tab and compare heap snapshots, you will see that some elements(Oval, Shapes...) are still in memory.

// EDIT //

If you have a look at the http://demos.kendoui.com/dataviz/line-charts/index.html line chart, you will find this leak. In your attached file are only Bars provided. So, maybe this help. We will work on it...

// EDIT //

Regards,

Markus.



0
Markus
Top achievements
Rank 2
answered on 24 Apr 2013, 01:42 PM
Hello again,

I figured out that a event listener is not removed when calling kendoDestory(). I modified chart count to 200 as suggested and also changed some code by myself in kendo.all.js. 

I attached two screenshots which will show you the improvement when using the modified code.

Regards,

Markus.
0
T. Tsonev
Telerik team
answered on 25 Apr 2013, 11:04 AM
Hello,

Thank you for taking your time to investigate this issue.

Which handler is not being detached? The destroy method detaches all handlers initialized in attachEvents, but obviously we're missing something.

Greetings,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Markus
Top achievements
Rank 2
answered on 25 Apr 2013, 11:40 AM
Hello Tsvetomir,

update lines 7863- 7887 in kendo.all.js.

Please feel free to change or edit my code style :)). I'm looking forward to get your feedback.

Best regards,

Markus.

   
// Edit
if (support.eventCapture) {
 var downEvents = kendo.eventMap.up.split(" "), idx = 0, length = downEvents.length, surfaceElement = that.surface[0];
that.preventIfMoving = function(e) {
if (that._isMoved()) {
                        e.preventDefault();
                    }
                };
                for (;idx < length; idx++) {
                    surfaceElement.addEventListener(downEvents[idx], that.preventIfMoving, true);
                }
            }
            that.bind([ PRESS, TAP, START, MOVE, END, CANCEL, GESTURESTART, GESTURECHANGE, GESTUREEND, GESTURETAP, SELECT ], options);
        },
        destroy: function() {
            var that = this, downEvents = kendo.eventMap.up.split(" "), idx = 0, length = downEvents.length, surfaceElement = that.surface[0];
            if (support.eventCapture) {
                for (;idx < length; idx++) {
                    surfaceElement.removeEventListener(downEvents[idx], that.preventIfMoving, true);
                }
                    }
that.element.kendoDestroy(that.eventNS);
that.surface.kendoDestroy(that.eventNS);
that._disposeAll();
that.unbind();
        },
0
T. Tsonev
Telerik team
answered on 25 Apr 2013, 01:33 PM
Hi,

Thank you! We'll fix this problem as soon as possible.

As a token of gratitude for your involvement your Telerik points have been updated.

Greetings,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Petyo
Telerik team
answered on 26 Apr 2013, 11:48 AM
Hi Markus,

I am glad to inform you that your suggestion has been incorporated in our codebase, and it will be available in our next internal build. 

Greetings,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Markus
Top achievements
Rank 2
Answers by
T. Tsonev
Telerik team
Markus
Top achievements
Rank 2
Petyo
Telerik team
Share this question
or