Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6823403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:46:43+00:00 2026-05-26T21:46:43+00:00

I have built an application using Visual Studio .NET and it works fine. After

  • 0

I have built an application using Visual Studio .NET and it works fine. After the application is used for more than 2-3 hours it starts to get slow and I don’t know why. I have used GC.Collect(); to get memory leak problems but now I have the new one.
Does anyone know a solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:46:44+00:00Added an answer on May 26, 2026 at 9:46 pm

    If you really have a memory leak, just calling GC.Collect() will get you nowhere. The GarbageCollector can only collect those objects, that are not referenced from others anymore.

    If you do not cleanup your objects properly, the GC will not collect anything.

    When handling with memory consumptions, you should strongly consider the following patterns:

    1. Weak Events (MSDN Documentation here)
      If you do not unsubscribe from events, the subscribing objects will never be released into the Garbage Collection. GC.Collect() will NOT remove those objects and they will clutter your memory.

    2. Implement the IDisposable interface (MSDN documentation here)
      (I strongly suggest to read this ducumentation as I have seen lots of wrong implementations.)
      You should always free resources that you used. Call Dispose() on every object that offers it!

    3. The same applies to streams. Always call Close() on every object that offers this.

    4. To make points 2. and 3. easier you can use the using blocks. (MSDN documentation here)
      As soon as these code blocks go out of scope they automatically call the appropriate Dispose() or Close() methods on the given object. This is the same, but more convinient, as using a try... finally combination.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Windows Forms (C#, .NET 2.0) application, built with Visual Studio
I have an asp.net mvc 2 application which works fine when run from visual
I have a Dynamic Data website built in Visual Studio 2008 using .NET 3.5
I have an application that works fine in Visual Studios 2008, and I am
I have an application that is built using ASP.NET, with an embedded Silverlight Object
I have an engineering firm and our website was built using Visual Studio 2010
I have built a small web application in asp.net c# in VS 2010 using
I am running a .NET 4.0 web application locally using the Visual Studio Development
I have a Visual Studio 2008 solution with an ASP.NET Web Application project. I
We have a ASP.Net web application running in Visual Studio 2010 that is targeting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.