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

[Solved] IE 9/Firefox 5 Grid javascript memory leak

9 Answers 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sebastian S
Top achievements
Rank 1
Sebastian S asked on 17 Aug 2011, 03:36 AM
Hi there,

Hope someone can help us. We have been doing some testing on our application and have noticed
the memory used in IE/Firefox climbs with time. We think we've traced this to a timer refresh.

This web app with a telerik grid, uses a timer to refresh this grid every 10 seconds. We've
modified the refresh to 200 ms to make the memory leak show up earlier.
We are using telerik MVC dated 2011.1.315.

Regards,
Sebastian

<script type="text/javascript">
	$(function () {
		setInterval('refreshRecent()', 10000);
	});
 
	function refreshRecent() {
		try
		{
			$('#Grid2').data('tGrid').ajaxRequest();
		}
		catch(err)
		{
		}
	}
</script>
 
@(Html.Telerik().Grid<MBM.Print.Wireless.WebUI.Models.JobModel>()
        .Name("Grid2")
        .DataKeys(dataKeys => dataKeys.Add(c => c.Id))
		.DataBinding(dataBinding => dataBinding.Ajax().Select("_Recent""Transactions"))
		.Pageable(paging => paging.Total((int)ViewBag.Total).Style(GridPagerStyles.NextPreviousAndNumeric | GridPagerStyles.PageInput))
		.EnableCustomBinding(true)
		.Resizable(resizing => resizing.Columns(true))
		.Columns(columns =>
			{
				columns.Bound(c => c.SMT).Title(Global.DateTime);
				columns.Bound(c => c.Prn).Title(Global.Printer);
				columns.Bound(c => c.Doc).Title(Global.DocumentName);
				columns.Bound(c => c.PGS).Title(Global.Pages).HtmlAttributes(new { style = "text-align:center" }).HeaderHtmlAttributes(new { style = "text-align:center" });
				columns.Bound(c => c.AT).Title(Global.Attributes);
				columns.Bound(c => c.Cst).Title(Global.Cost).HtmlAttributes(new { style = "text-align:right" }).HeaderHtmlAttributes(new { style = "text-align:center" });
			}))

9 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 17 Aug 2011, 10:13 AM
Hello Sebastian S,

Actually, I'm able to observe almost the same behavior using only jQuery:

<script type="text/javascript">
    $(function () {
        setInterval(refreshRecent, 1000);
    });
  
    function refreshRecent() {
        try
        {
            $.getJSON('@Url.Action("_Select", "Home")', function() {});
        }
        catch(err)
        {
        }
    }
</script>


All the best,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

0
Sebastian S
Top achievements
Rank 1
answered on 17 Aug 2011, 10:41 PM
Hi Rosen,

I'm assuming you mean the grid uses $.getJSON and that it causes a leak?

Cheers,
Sebastian
0
Accepted
Rosen
Telerik team
answered on 18 Aug 2011, 07:02 AM
Hello Sebastian S,

Indeed, it uses $.ajax. As seen from my previous message there is an increase in memory consumption even when using only jQuery ajax therefore I suspect that the main cause for the issue is indeed this.

All the best,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

0
Sebastian S
Top achievements
Rank 1
answered on 18 Aug 2011, 07:03 AM
Ok - thanks Rosen.
0
Sebastian S
Top achievements
Rank 1
answered on 26 Aug 2011, 12:57 AM
Hi Rosen,

We have tested this with jquery 1.6.2. It does not leak memory.
We are sure the Telerik Grid LEAKS CLOSURES.

Please advise.

--Sebastian
0
Accepted
Rosen
Telerik team
answered on 26 Aug 2011, 08:22 AM
Hi Sebastian S,

Unfortunately, I'm getting the same as previous behavior even with the jQuery 1.6.2. Please take a look at this short video. Maybe I'm missing something obvious.

Regards,
Rosen
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Sebastian S
Top achievements
Rank 1
answered on 28 Aug 2011, 10:07 PM
Hi Rosen,
Thanks for going through all that effort. We initially did the same thing.
If we do the $getJSON test without Firebug on the memory seems to remain stable  :).

Cheers,
Sebastian

P.S. A colleague of mine did a similar test with Google Chrome because Firefox seemed to leak memory randomly. The results showed jquery 1.6.2 being fairly stable.

0
Accepted
Nikolay Rusev
Telerik team
answered on 29 Aug 2011, 10:25 AM
Hello Sebastian,

I've just tested in latest official Google Chrome and it seems that the behavior is the same. See the video for more details ( the test project is the same as of my colleague Rosen).
http://screencast.com/t/rs7SGd3CfAKb

Best wishes,
Nikolay
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Sebastian S
Top achievements
Rank 1
answered on 30 Aug 2011, 12:23 AM
Hi Nikolay,

I can confirm the same behaviour with the latest Google Chrome build.

Thanks for you help guys.

Sebastian
Tags
Grid
Asked by
Sebastian S
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Sebastian S
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or