Yes .As far as I have read one cannot tell when is an object going to be garbage collected.But I fail to understand that what is the function of System.gc(),as this method is supposed to invoke garbage collection explicitly but every book worth it's name say's that it's not possible.Can anybody put some light on System.gc().