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 6360961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:42:55+00:00 2026-05-24T23:42:55+00:00

This sounds a little odd, but I’m not sure if my process has a

  • 0

This sounds a little odd, but I’m not sure if my process has a memory leak or not, and I was hoping to get some information.

I was recently assigned an investigation into why a windows service in production was consuming roughly a gig of ram (the server it is running on has 8 gigs). This is outside of my experience as a developer, but it’s been a very good chance for me to read up on how garbage collection is working on msdn and other sources. But at this point I’m very confused about /when/ collection actually runs, on this point, ever article I read is vague.

1) I have found a specific operation that increases memory by ~30kb each time it is executed.
2) I have very carefully gone over the code and believe that I am properly closing everything, and removing references
3) I have used several memory profilers, all of them seem to indicate that my old objects are linked to the gc.
4) If I leave the process absolutely idle for a few days, the memory usage suddenly plummets down to ~8 megs

So based on this, I’m not even sure I have a memory leak. Given that GC is an expensive process, is it possible that I grew to 1 gig in production just because there was still free ram to be had, and acquiring it was “cheaper” than running GC? Especially given that this service is run ~6 times a second? If this is the case, what options do I have? I am of the understanding that I cannot forceably trigger GC, do I have any resort?

Thank you for any input you might have, I realize memory leaks and gc in csharp is a deep topic and if there’s a particularly helpful read on the subject, I’d be happy to be pointed that way as well.

  • 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-24T23:42:56+00:00Added an answer on May 24, 2026 at 11:42 pm

    You certainly CAN force a garbage collection – just call GC.Collect. It’s not that you can’t but that the garbage collector usually does a better job of figuring out when it should run than you do. But here, you can call it explicitly – as a debugging tool – to see whether or not the allocated memory is eligible for collection.

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

Sidebar

Related Questions

Sorry if this question sounds a little silly, but I am not sure what
Maybe this sounds a little bit crazy, but I need to come up with
I realize this sounds a little crazy, but I'm working on a project for
This sounds dumb, but I can't get it to work. I think i just
The question probably sounds a little odd, but the actual task is relatively simple,
I have read about password salting, but this might sound a little odd. But
I know that question sounds a little odd but i will try to explain
I know this sounds a little ridiculous, but I'm just honestly wondering how I
I know this sounds a little bit specific but I was just wondering where
This sounds funny..just a little experiment. i wanted to simulate a drag drop of

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.