"Form.ShowDialog" Method Slows Screen Display

Asked 2 years ago, Updated 2 years ago, 45 views

Currently, after executing SQL statements in the application created with C#, we are conducting a continuous test to display the screen.
If you do the above continuous tests for approximately 3-4 hours, the screen will take approximately 5 seconds to display.
(less than 1 second before continuous testing) Also, if you increase the test time for continuous tests, the display time of the screen increases proportionally.

The screen is displayed using WindowsForm's Form.ShowDialog method, and following the following process, we were able to confirm that the FocusActiveControlInternal method provided by .NetFramework experienced delays.
However, the FocusActiveControlInternal method cannot follow the source code and cannot determine the cause.

I'm sorry, but I'd appreciate it if you could tell me the possible causes and investigation methods based on the above information.

c#

2022-09-30 19:19

1 Answers

As far as I'm concerned, it seems to be a typical resource leak (which is causing more hard faults). SQL statements have connections to the database = Unmanage resources, so I suspect that Dispose() of unmanage resources is leaking. Dispose() leakage can be prevented by properly using.

Check source if it is confirmed to be leaking

If it's Oira, we'll start investigating around here.

If you want to see the source of the Microsoft .NET Framework, it's posted on https://referencesource.microsoft.com/, so if you google the site, it'll be easy to hit.

FocusActiveControlInternal() is
https://referencesource.microsoft.com/ #system.windows.forms/winforms/managed/system/winforms/ContainerControl.cs


2022-09-30 19:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.