Potential Memory Leak

Simon Scott 306 Reputation points
2022-09-12T10:58:27.567+00:00

Good morning all,

I have an Windows form based app which runs on various PC's 24/7.

However, the application over time consumes RAM and the PC will crash if not restarted manually.

My initial thoughts are to set a timer on the APP to restart after a certain period of time. However, i feel this isn't the best way to do this.

Can anyone help?

Thanks
Simon

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,263 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 40,156 Reputation points
    2022-09-14T08:44:23.42+00:00

    However, i am a basic programmer and have no idea what to do!

    Run the VS Code Analysis, it show common design failures, like missing .Dispose() calls on managed objects, which causes high memory consumption.

    https://github.com/MicrosoftDocs/visualstudio-docs/blob/main/docs/code-quality/how-to-run-code-analysis-manually-for-managed-code.md


1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 53,426 Reputation points
    2022-09-12T17:39:11.92+00:00

    the best solution is to fix the memory leak.