none
Transparancy Key Memory Leak issue RRS feed

  • Question

  • Hi everyone!

    So ive discovered a bit of an issue on my end with a memory leak that appears to be with the transparancy key option.

    Pretty easy to replicate:
    1. Create a standard windows form
    2. Change the form's transparancy key to any color
    3. Open Task Manager

    4. Debug and start resizing the form.
    5. Notice Desktop Window Manager start to rapidly blow out in memory size from 64 mb to 5gb in just a few seconds of resizing. With no way of clearing the memory without logging off.

    Im using VS 2019, dotnet 4.7.2 windows 10.

    any ideas guys? this one has has me stumped?
    Regards
    James

    Saturday, July 11, 2020 11:55 AM

Answers

  • This is not reproducible with VS 2015

    (Windows 10 1909, .NET 4.7.2)

    Saturday, July 11, 2020 1:20 PM
  • I cannot replicate any issues. While resizing DWM goes up but as soon as the resize is done it drops back down to normal memory. In all cases though my committed memory is not increasing in any significant manner. Closing the app and running it multiple times didn't change anything.

    You could be having a driver issue. I don't think we're going to be able to help you in the C# forums. At a minimum there could be a problem in the Windows Forms code but since that just calls into Win32 the problem would more likely be there. You can submit a bug report to MS about it and see what they say. If you think it is with the framework then start there and see what they think.


    Michael Taylor http://www.michaeltaylorp3.net

    Saturday, July 11, 2020 1:40 PM
    Moderator

All replies

  • This is not reproducible with VS 2015

    (Windows 10 1909, .NET 4.7.2)

    Saturday, July 11, 2020 1:20 PM
  • After some experimenting on my wife's PC I think there is an issue with DirectX or my windows installation as I could not replicate it on 2 other machines. A reinstall of Windows might be in order. Thanks again :)
    Saturday, July 11, 2020 1:23 PM
  • I cannot replicate any issues. While resizing DWM goes up but as soon as the resize is done it drops back down to normal memory. In all cases though my committed memory is not increasing in any significant manner. Closing the app and running it multiple times didn't change anything.

    You could be having a driver issue. I don't think we're going to be able to help you in the C# forums. At a minimum there could be a problem in the Windows Forms code but since that just calls into Win32 the problem would more likely be there. You can submit a bug report to MS about it and see what they say. If you think it is with the framework then start there and see what they think.


    Michael Taylor http://www.michaeltaylorp3.net

    Saturday, July 11, 2020 1:40 PM
    Moderator
  • Yeah I have a feeling its to do with my machine in some way it literally never frees the dwm and it keeps going until it gets to about 14gb and then the PC reaches its limit :/. I'll do a Windows reinstall soon.

    Thanks again :)

    Saturday, July 11, 2020 1:44 PM
  • You might also try following some suggestions related to DWM memory usage. Some relevant posts I've seen. nVidia used to be a popular problem.

    https://social.technet.microsoft.com/Forums/en-US/a4594475-9676-4278-8e41-0fd26e4f5739/dwm-memory-leak-window-64b-1709?forum=win10itprohardware

    https://stackoverflow.com/questions/39468413/dwm-memory-leak-on-nvidia-gpu-while-running-simple-uwp-app


    Michael Taylor http://www.michaeltaylorp3.net

    Saturday, July 11, 2020 1:51 PM
    Moderator
  • Thank you for these links. This may be what I am experiencing thisvlaptop also has a Nvidia gpu and I am also using SetLayeredWindowAttributes which the post also said had issues with it, however my issue seems to occur only with the transparency key option. I'll look into this first thing tomorrow morning. Thanks so much.

    Regards

    James



    Saturday, July 11, 2020 1:55 PM