R
raghu
Why there is no guarentee for System.gc() method will perform garbage
collection for a particular time?
collection for a particular time?
Why there is no guarentee for System.gc() method will perform garbage
collection for a particular time?
raghu said:Why there is no guarentee for System.gc() method will perform garbage
collection for a particular time?
Chris said:It's distressingly common to see people quote #1 rather ferociously, and
then ignore #2. So to reiterate, you are GUARANTEED that when the
system returns from System.gc(), a best effort has been made to perform
any garbage collection work that can be done. The two statements --
Thomas Hawtin said:Perhaps it's just people with long memories of when System.gc was fast.
Then one version, programs that call it lots slowed to a crawl.
Why there is no guarentee for System.gc() method will perform garbage
collection for a particular time?
Chris said:I've been working in Java since the summer of 1997, and I don't recall
its ever being particularly fast. Not that I write much code that calls
it.
Thomas said:I have a memory of a thread posted hereabouts around the 1.2->1.3 era
(possibly) revolving around, IIRC, an image process library. The code
slowed down significantly when upgrading. IIRC, it turned out that
System.gc used to pretty much be ignored if there had just been a
significant collection. The code called System.gc often, so with the old
version it ignored most of them. However, I can't find anything relevant
on groups.google.com.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.