About Garbage Collector

In Java, there is one system call for garbage collector.

System.gc();

I want to know the significance of this system call for GC. Even after calling this method, garbage collector won't get started, still it will run on its own time.

If this is the thing then what's the significance of this method call?

Please let me know this.

Thanking you,

Ketan

[394 byte] By [KeDeSola] at [2007-11-26 18:52:23]
# 1
It's a hint for the system, saying "now might be a good time to run gc". It's not very useful for the average developer, although some people have managed to trigger the gc by calling that method several times in succession.I wouldn't worry about it.
-Kayaman-a at 2007-7-9 6:26:25 > top of Java-index,Java Essentials,Java Programming...
# 2
Calling gc is request to VM and not command. This increases priority of running gc thread.
advaitsamanta at 2007-7-9 6:26:25 > top of Java-index,Java Essentials,Java Programming...
# 3

Addendum

In a heavy data application, for instance, that stores records in memory for some purpose, then releases that memory and creates next set of records in memory, calling gc really help.

We have such application where in we tested its performance with and without calling gc. No wonder, we found better results by calling gc.

advaitsamanta at 2007-7-9 6:26:25 > top of Java-index,Java Essentials,Java Programming...
# 4
> Calling gc is request to VM and not command. > This increases priority of running gc thread.What? Are you sure about that? Where have you read that it increases the priority?
kajbja at 2007-7-9 6:26:25 > top of Java-index,Java Essentials,Java Programming...
# 5
> What? Are you sure about that? Where have you read> that it increases the priority?Where did he read that there's necessarily a GC thread? ;)
CeciNEstPasUnProgrammeura at 2007-7-9 6:26:25 > top of Java-index,Java Essentials,Java Programming...
# 6
> Calling gc is request to VM and not command. True.> This increases priority of running gc thread.False.
karma-9a at 2007-7-9 6:26:25 > top of Java-index,Java Essentials,Java Programming...