Closed shashidhar-ks closed 1 week ago
It looks like you have an accessibility tool running (as you're getting ControlAccessibleObjects). Trying this with both .NET 8 and 9 with and without Narrator running I didn't see anything particularly concerning.
.NET 9 RC1 will be out shortly and would be worth comparing. The accessibility interop code has been completely rewritten and may impact what you're observing.
Sorry for delay in reply. The main issue I want to bring to notice is that, the private byte memory of the application increase, which never goes down. Since it never goes down, calling it as memory leak.
Following contains data of private memory, when we execute the application mentioned in the description.
Private bytes when applications starts -> 7864K Private bytes when applications starts + 10 mins -> 13272K Private bytes when applications starts + 20 mins -> 19832K Private bytes when applications starts + 45 mins -> 37568K Private bytes when applications starts + 65 mins -> 51744K
We can't really move forward with this without more data. We aren't seeing this issue with the repro application. If we can get more information to proceed we'd be happy to take a look further, but there isn't enough information here to proceed further.
.NET version
.NET 8 (8.0.8)
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No response
Issue description
Private bytes of the .NET 8 Windows Form application keeps increasing, when we open and close a Form.
The steps to reproduce section has details on how to reproduce it faster in a simpler way.
I used memprofiler to confirm that there are no leaks in the source code I have used. Memprofiler mentioned that there are increase in the types of object as mentioned in the below image.
Note: We are calling
GC.Collect()
andGC.WaitForPendingFinalizer()
at regular interval and still the private bytes of the application keeps increasing.Steps to reproduce
WinFormsApp1.zip
The application is doing the following:
Form2
that has checkbox, combobox and textbox controls (all from System.Windows.Forms namespace).Form2
has hooked onto Load event in which it creates a Timer which is configured to call a function in one sec.Form1
that has a button.Form2
, calls ShowDialog and disposes the instance when it is done.So, clicking on the button will continuously creates and closes new Window Form. By monitoring Private Bytes of the application, we can see that memory of the application keeps increasing.