[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Certification study group issue: Will the Garbage Collector pick up the rubish is you call it?
- To: <CJeness@bellsouth.net>, <firstname.lastname@example.org>
- Subject: RE: Certification study group issue: Will the Garbage Collector pick up the rubish is you call it?
- From: <Vikrant.Verma@alltel.com>
- Date: Wed, 13 Nov 2002 12:17:14 -0600
- Thread-Index: AcKLNpZv+cDzXZvLS52qEoDJ380ucQACCY8w
- Thread-Topic: Certification study group issue: Will the Garbage Collector pick up the rubish is you call it?
that must absolutely hold true. I am only experienced with sun's
Just as an FYI read this article on the GC.
I have not tested system.gc in all jdk's. Also I do not recommend
system.gc calls within a class to force garbage collection.
From: Cynthia Jeness [mailto:CJeness@bellsouth.net]
Sent: Wednesday, November 13, 2002 11:33 AM
Subject: Re: Certification study group issue: Will the Garbage Collector
pick up the rubish is you call it?
This really depends on the VM. The IBM VM's tend to delay garbage
collection as long as possible while the Sun VM's tend to compy with
> I have read the JVM specs and it says that the call to System.gc() is
> merely a suggestion to the VM. But in my personal experience whenever
> made a call to System.gc() it did force a gc.
> >From certification point of view follow what the VM specs say, its
> merely a suggestion and not a reliable way of executing a gc.
> -----Original Message-----
> From: Matthew Phillips [mailto:email@example.com]
> Sent: Wednesday, November 13, 2002 11:09 AM
> To: firstname.lastname@example.org
> Subject: Re: Certification study group issue: Will the Garbage
> pick up the rubish is you call it?
> Part I:
> Both of those methods suggest the garbage collector
> should run. There is no way to force it to run.
> Part II:
> I have never had to use either of these methods. I
> assume that the advantage is that you may want to try
> to run the garbage collector on a different schedule
> that the JVM. The methods give you a way to attempt
> to do this.
> --- Lee Chalupa <email@example.com> wrote:
> > Can someone give me an Amen on this issue? There
> > are two parts to this issue
> > Part I:
> > An issue that came out of last night's meeting was
> > from the following question:
> > "The method System.gc forces the garbage collection
> > process to run."
> > True or False.
> > We are not sure.
> > Here is the research that I have found on the topic:
> > Mike Meyers has published a few editions of his
> > certification book.
> > Mike Meyer's book states: "You cannot force the
> > garbage collector to reclaim memory."
> > He explains elsewhere: "While you cannot force the
> > garbage collector to reclaim memory, you can suggest
> > that it
> > do so by calling the java.lang.System.gc() method or
> > the java.lang.Runtime,getRunTime().gc() method.
> > Both of these
> > methods send a request to the garbage collector
> > asking it to reclaim memory. The garbage collector
> > can honor or
> > ignore the request at its whim.
> > I assume in other words this means that the garbage
> > collection can just ignore the request and refuse to
> > run.
> > Here is another post I found on a java web site. I
> > have no idea how credible this source is.
> > " System.gc() does not mean the garbage collector is
> > called, it only suggests that the VM call it."
> > Part II:
> > Ok. If the answer is True, then what is the value of
> > invoking a method that has the discretion to
> > run or not run. If it wanted to run it would run
> > without me invoking the method in the first place
> > wouldn't it?
> > Thanks for the help.
> > Lee Chalupa
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos