Memory leak problem when set the Grid.Style.BorderColor property

Hello,

I noticed 2 problems a long time ago, but only now I had time to find the reasons.

  1. problem: When I set the BorderColor property of the grid in Designer.cs file, a memory leak appear. At runtime the GDI objects count increasing every second with 9-10 new items also in idle form too. I can watch the GDI objects count in Windows Task Manager. When it is reach 10000 my application crashing with GDI+ exception. My application always gets slower as the number of GDI objects increases.

    Please check attached video memoryleak.mp4

    When I remove the BorderColor property from the Designer.cs file, the memory leak not appear anymore.

    Please check the sample app and remove line 67. from this file:
  2. WinFormsApp1\Fomenu.NET\Controls\GridContainer.Designer.cs



    Can you help me please why this memory leak happen with this property and how can I fix it?

  3. Second problem is throwing in designer mode in Visual Studio 2022. When I select the button in designer mode its start vibrating and never stops.
  4. With many objects, the designer will become slower and slower, and eventually it will have to be restarted. Please watch attached video (vibrating.mp4) to see the problem. Do you have any idea why this happen?


Please check the following url for sample project and videos.

Reproduce the issue:
- Start project
- Click on button
- Set focus to grid (if it not enough make a sort)
- Check the GDI object increasing in Task Manager


Thank you for help!

BR, László

4 Replies 1 reply marked as answer

VD Vasanthkumar Durairaj Syncfusion Team November 28, 2022 02:41 PM UTC

Hi SZL,

Find the response for the query below.


Query

Response

problem: When I set the BorderColor property of the grid in Designer.cs file, a memory leak appear. At runtime the GDI objects count increasing every second with 9-10 new items also in idle form too. I can watch the GDI objects count in Windows Task Manager. When it is reach 10000 my application crashing with GDI+ exception. My application always gets slower as the number of GDI objects increases.

Please check attached video memoryleak.mp4

When I remove the BorderColor property from the Designer.cs file, the memory leak not appear anymore.

Can you help me please why this memory leak happen with this property and how can I fix it?


We have created a bug report for the reported issue “
Memory leak occurs when the BorderColor property is set to SfDataGrid”. So, we will fix this issue and include it in our first NuGet release on after the Essential Studio 2022 Volume 4 release.

 

You can track the status of this report through the following feedback link:

 

Feedback Link:  https://www.syncfusion.com/feedback/39436/memory-leak-occurs-when-set-the-bordercolor-property-to-sfdatagrid
 

Note: The provided feedback link is private, and you need to login to view this feedback.

 

We will let you know once it is released. We appreciate your patience until then.

 

  1. Second problem is throwing in designer mode in Visual Studio 2022. When I select the button in designer mode its start vibrating and never stops.

With many objects, the designer will become slower and slower, and eventually it will have to be restarted. Please watch attached video (vibrating.mp4) to see the problem. Do you have any idea why this happen?

 

We have checked the issue on our end. But the issue has not been replicated for us.


If this issue persists, you can submit a query to MSDN.



SZ SZL replied to Vasanthkumar Durairaj November 29, 2022 07:28 AM UTC

Hi,


Thank you for help!

The second problem is gone in my side too, not understand why, I watch it in the future and I will write to MSDN when occurs again. I wrote here just because with the original NET controls it didn't appear.


BR, SZL




DM Dhanasekar Mohanraj Syncfusion Team December 30, 2022 10:30 AM UTC

SZL,

We would like to let you know that Essential Studio Weekly NuGet packages (v20.4.0.41) have been published in nuget.org with the fix for the issue Memory leak occurs when the BorderColor property is set to SfDataGrid. Please let us know if you have any concerns about this.


Marked as answer

SZ SZL replied to Dhanasekar Mohanraj January 4, 2023 07:26 PM UTC

Hi,


Thank you very much, its works fine!


BR, SZL


Loader.
Up arrow icon