Re: Calling GC routine in alternative ways

From: Dan Nuttle (d_nuttle_at_hotmail.com)
Date: 03/08/04


Date: Mon, 08 Mar 2004 04:12:04 GMT

Not only is there no difference, there really is no point in calling the
garbage collector. First, there is no guarantee when your request will be
processed. It doesn't necessarily happen right away. And second, the JVM
has an algorithm that determines when to call the garbage collector
automatically anyway. (This algorithm varies from JVM to JVM, with
potentially dramatic effects on performance under high-load conditions.)

Calling the garbage collector manually doesn't buy you anything, so far as I
know. Putting the ability to call gc manually into Java was, quite frankly,
a mistake. This mistake (unlike some others) is harmless, because calling
the gc won't hurt anything. Of course, if the ability to call the gc leads
you to believe that you have a level of control over the JVM that you don't
have, that might lead to poor design or coding decisions.



Relevant Pages

  • Re: Calling GC routine in alternative ways
    ... if the program is about to play animation or ui ... And second, the JVM ... > has an algorithm that determines when to call the garbage collector ... > Calling the garbage collector manually doesn't buy you anything, ...
    (comp.lang.java.help)
  • Re: Do you still choose java????
    ... I found IBM's JVM buggy, ... collector is less intrusive and is smoother. ... garbage collector much easier, and providing smoother results. ... QA needs to spend more testing time using the compiled exe, ...
    (comp.lang.java.developer)
  • Re: Do you still choose java????
    ... I found IBM's JVM buggy, ... collector is less intrusive and is smoother. ... garbage collector much easier, and providing smoother results. ... QA needs to spend more testing time using the compiled exe, ...
    (comp.lang.java.programmer)
  • Re: Do you still choose java????
    ... I found IBM's JVM buggy, ... collector is less intrusive and is smoother. ... garbage collector much easier, and providing smoother results. ... QA needs to spend more testing time using the compiled exe, ...
    (comp.lang.java.softwaretools)
  • Re: Memory Cleanup
    ... Calling GC.Collect is not the ... // The total memory has not gone down. ... reference counters, and nothing happens when objects go out of scope. ... objects just remain in memory waiting for the garbage collector to remove ...
    (microsoft.public.dotnet.languages.csharp)