Completed
Last Updated: 15 Mar 2021 14:29 by ADMIN
Release LIB 2021.1.322
LindenauAtSOG
Created on: 01 Mar 2021 11:58
Category: GridView
Type: Bug Report
3
GridView: Memory leak caused by QueryableExtensions

The class Telerik.Windows.Data.QueryableExtensions has a static dictionary "providerIsEntityFrameworkCore"

That dictionary will hold a reference (forever) to a collection that is set as Source for the GridView.

Reason is that non IQueryable-types will be wrapped in a EnumerableQuery<T> that will return itself as the provider (https://referencesource.microsoft.com/#System.Core/System/Linq/SequenceQuery.cs,44), encapsulating the reference.

This must be something introduced recently.

2 comments
ADMIN
Ivan Petrov
Posted on: 04 Mar 2021 15:25

Hi Christian,

Thank you for the insightful explanation of the issue. Indeed, this is something we added several months back when EntityFramework Core 3.0 was introduced. EF Core 3.0 introduced a breaking change where, if an expression could not be translated to SQL, an exception will be thrown. It replaced the old behavior where the execution would "silently" switch to client-side evaluation. Now if this switch to client-side evaluation is necessary it must be made explicitly clear. This is why we need to know whether we are dealing with EF Core provider(s).

I hope this is informative and useful. Should have further thoughts, I would be glad to hear them out.

Regards,
Ivan Petrov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

LindenauAtSOG
Posted on: 01 Mar 2021 12:02
Proposed solution: 

Change the method IsEntityFrameworkCore to not use the Dictionary if source is EnumerableQuery.