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

  • Home
  • SEARCH
  • 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 7984367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:14:52+00:00 2026-06-04T11:14:52+00:00

During Runtime I find that there is a very big memory usage by my

  • 0

During Runtime I find that there is a very big memory usage by my application..

But It seems that I only use 3~4 MemoryStreams one of which is sometimes full of 81 Mb..

The others are mainly 20 mb, 3 mb and 1mb containers…

But still there is 525.xx MB memory usage by the application…

I tried using using(...) statements also but without any luck..

So, I am asking here for the most efficient way to cut down memory leaks.

  • 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-06-04T11:14:54+00:00Added an answer on June 4, 2026 at 11:14 am

    In managed .NET apps, you don’t generally have memory “leaks” in the original sense of the word, unless you are allocating unmanaged resource handles and not disposing of them correctly. But that doesn’t sound like what you’re doing.

    More likely is that you are holding on to references to objects that you no longer need, and this is keeping the memory “alive” longer than you are expecting.

    For example, if you put 5MB of data into a memory stream, and then assign that memory stream to a static field, then the 5MB will never go away for the lifetime of the application. You need to assign null to the static field that refers to the memory stream when you no longer need what it points to so that the garbage collector will release and reclaim that 5MB of memory.

    Similarly, local variables are not released until the function exits. If you allocate a lot of memory and assign it to a local variable, and then call another function that runs for hours, the local variable will be kept alive the whole time. If you don’t need that memory anymore, assign null to the local variable.

    How are you determining that your app has a memory leak? If you are looking at the process virtual memory allocation shown by Task Manager, that is not very accurate. An application’s memory manager may allocate large chunks of memory from the OS and internally free them for other uses within the application without releasing them back to the OS.

    Use common sense practices. Call dispose or close as appropriate and assign null to variables as soon as you no longer need their contents.

    Just because the garbage collected environment will let you be lazy doesn’t mean you shouldn’t pay attention to memory allocation and deallocation patterns in your code.

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

Sidebar

Related Questions

Say there is a dict variable that grows very large during runtime - up
I find that my Flex application's UI becomes unresponsive during very long processing loops
Is there a way to change the application language during runtime? So, after the
Is there an easy way to debug code that is compiled during runtime with
How can I know during runtime that my code threw a Warning? example try
i am trying to modify during runtime an image in my application, this image
i am adding more than one link button during runtime but they all have
I have a stackpanel with some usercontrols that are added or removed during runtime.
In my ASP.NET application there's MyAssembly.CustomIdentity class and the .NET runtime tries to serialize
I'm developing a WPF based application that must play some videos during its execution.

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.