This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
The garbage collector cannot ensure that there will always be enough memory.
The garbage collection (GC) algorithm varies from one JVM to another.
There are different algorithms being used, like reference counting or the mark and sweep algorithm.
Please google up for more insight to those algorithms.
To request garbage collection, you can call either of the following methods: