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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:10:25+00:00 2026-05-11T11:10:25+00:00

I found this piece of code inside System.Web.ISAPIRuntime using Reflector public void DoGCCollect() {

  • 0

I found this piece of code inside System.Web.ISAPIRuntime using Reflector

public void DoGCCollect() {     for (int i = 10; i > 0; i--)     {         GC.Collect();     } } 

Can anyone comment on this? Is there a reason to do GC.Collect() in a loop? Why 10 times and not 3, 5 or 20? Analysis indicated that it’s not used inside .net framework but it’s public so I suppose that IIS could call it…

edit :

Just for clarification purposes : I have never called GC.Collect and I have no intentions of using it. I know it’s a bad idea in most (if not all) cases. The question is why .net framework does it. Thanks for all your answers.

  • 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. 2026-05-11T11:10:25+00:00Added an answer on May 11, 2026 at 11:10 am

    I don’t think you’re going to get a better explanation that ‘one of Microsoft’s programmers is pretty clueless, and apparently, no one else bothered to look at his code before it was checked in’. 😉

    It does look scary though.

    It’s a fairly common response to bugs you don’t understand though. For whatever reason, you’re trying to call the GC, and somehow, calling it doesn’t seem to solve your problem (perhaps the real problem was just that you should wait for the finalizer thread or something), so the naive solution is obviously ‘Well, I’ll just keep calling it then’.

    Similar to pressing ‘print’ repeatedly until your document is printed.

    Perhaps you should submit it to thedailywtf.com though.

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

Sidebar

Ask A Question

Stats

  • Questions 146k
  • Answers 146k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Perhaps you want to look at something like the WPF… May 12, 2026 at 9:00 am
  • Editorial Team
    Editorial Team added an answer Have you changed the default font size on either Chrome… May 12, 2026 at 9:00 am
  • Editorial Team
    Editorial Team added an answer Do you need to return pure HTML (as opposed to,… May 12, 2026 at 9:00 am

Related Questions

It's right there, in the package that it should be indexing. Still, when I
I have this piece of code: <script language=javascript type=text/jscript> document.write(<img src='http://dm.leadgenesys.com/jpgp.lgt?en=P.........TP_Q=&amp;ur=' + escape(document.referrer) +
In my project I found a piece of code in which a method was
On the first click, it works as expected: the class is changed and the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.