Closed langelo1 closed 2 years ago
I discovered that the "memory leak" does not occur when the GLControl Profile is set to "Compatibility" mode instead of the default "Core" mode. Also, the APIVersion property must be set to 3.3.0.0. During troubleshooting I had set the APIVersion to 4.6.0.0.
Also, I don't know if the problem was actually a memory leak, or just a lack of garbage collection. Again, I'm a beginner, so take what I say with a grain of salt.
What kind of leak where you seeing? How much memory was allocated and where did you see that number (Visual studio, task manager, etc)? @seanofw you know more about the specifics of the implementation here but I don't see the logic behind Compatibility vs Core effecting this but maybe you could do a sanity check and see if you also get the leak?
I observed the leak in the Process Memory tracker in Visual Studio. The process memory spiked rapidly while resizing the window. The increase in process memory was proportional to the size of the window being resized. Resizing the window while close to its maximum size caused the process memory to exceed 3GB in about 10 seconds which caused the program to crash.
Today I was able to run the same app on a computer with a discrete graphics card and the leak did not occur even with the GLControl set to “core” mode.
I haven't been able to reproduce this, but I don't have anything to test on that has an integrated Intel graphics card either. Intel's drivers are known to have bugs; if I had to bet on anything, I'd bet that the memory is being leaked outside of .NET by Intel's drivers.
@langelo1 Do you have any further information on this? Nine months later, I'm inclined to close this issue as "can't reproduce."
I'm experiencing a severe memory leak when resizing a GLControl that is docked inside the parent form. This occurs when running the demo project OpenTK.WinForms.TestForm.csproj included in the latest OpenTK 4.x WinForms library. I first noticed this issue in my own project that I created from scratch following the examples provided in TestForm.csproj.
To reproduce this issue:
Things that might be of interest: