ZedGraphControl constructor suddenly takes a lot of memory

145 views Asked by At

I have a WPF application that I've been using about 1 year ago. Suddenly it started taking a lot of time to start when running it from VS2015 (around 5 minutes).

I checked the task manager and it seems that the application's instance is taking 8,500 MB from memory on startup, while decreasing to around 3,900 MB later.

I created a release folder and tried it on several PCs and it worked fine. It seems that this problem is only on my PC.

EDIT

I started debugging my program after InitializeComponent() and found out that using ZedGraphControl zedGraph = new ZedGraphControl(); is the one causing this problem. I tried to run old solutions that have been working before and now I have the same problem on them.

Note that I have been using ZedGraphControl in many projects and even in this project but this behavior suddenly appeared.

2

There are 2 answers

7
Valentin Peta On BEST ANSWER

Check in your Windows Update History if you have installed the Cumulative Update KB5001337 (for Windows 10). In my case, that was the culprit. Uninstalling KB5001337 should help (at least temporary). Updating Windows 10 to version 20H2 will also solve the problem.

1
Sara Liu - MSFT On

I think you have installed the nuget package ZedGraph, you could try the following:

1) clean nuget caches, delete all files under C:\Users\xxx\.nuget\packages and also delete the folder <solution_folder>\packages

after that, run update-package -reinstall under Tools-->Nuget Package Manager-->Package Manager Console

2) close VS, delete .vs hidden folder under the solution folder, bin and obj folder and then restart your project to test again.

3) disable any third party extensions under Extensions-->Manage Extensions-->Installed.

4) reset vs settings under Tools-->Import and Export Settings--> Reset vs settings

5) type devenv /safemode under Developer Command prompt for VS to start a new pure VS to test again.