You could switch to the visual studio 2022 64 bit version.
Assistance Required for Resolving "System.OutOfMemoryException" in Visual Studio
Subject: Help Needed with System Out-of-Memory Issue in Visual Studio
Hello Everyone,
I hope you're all doing well. I'm working on a project in Visual Studio that includes a large number of forms, user controls, and images used as icons. However, I am facing a problem where I am unable to make or save any changes to the project. When I try to implement modifications, I get the following error:
Error: "Exception of type 'System.OutOfMemoryException' was thrown."
I would appreciate any suggestions or solutions to resolve this issue.
Technologies Used:
- C# Language with WinForms
- Target framework: .Net Framework 4.7.2
- Frameworks and Libraries:
- AForge.Video.DirectShow
- Dapper
- Guna.UI2.WinForms
- MaterialSkin
- Zen.Barcode.Rendering.Framework
- Database: MS SQL Server 2019 (Programmability)
- IDE: Visual Studio 2019Project Specifications:
- Number of Classes: 12
- Number of User Controls: 23
- Number of Forms: 51
- Number of Images in Resources Folder: 395
- Total Lines of Code: 22,876
Given these details, I would greatly appreciate any suggestions or solutions to address the memory issue. I look forward to your expert guidance.
Thank you for your time and consideration.
Best regards, [Hoshyar Hussein Mohammed]
2 answers
Sort by: Most helpful
-
-
Jiachen Li-MSFT 32,456 Reputation points Microsoft Vendor
2024-10-08T01:58:16.2233333+00:00 Hi @Hoshyar Hussein ,
Earlier versions of Visual Studio is a 32-bit process, which means it can only use about 2 GB of memory. You can switch to Visual Studio 2022 (which is a 64-bit application), allowing the IDE to utilize more memory, especially for large projects.
If you have many images in your resources folder, consider loading some of them from an external file or a CDN instead of embedding them directly into the project.
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.