saloni jhanwar wrote:
I read like that we don't know when JVM will delete eligible objects.When JVM will find any need to delete eligible object like on low memory then it will delete.I am not getting exact meaning of that line.Does that mean JVM will surely delete all eligible objects of class just before program exit ?
No. The standard Oracle JVM only does a GC when it needs memory. It doesn't need memory to exit. It just exits.
saloni jhanwar wrote:
or even after program exit there will be eligible objects of that class for GC.
There is no such a thing as eligible objects after the JVM exits. There is no such a thing as classes after the JVM exits. It is just a bunch of resources, including memory resources, that the operation system will reclaim when the program (in this case, the JVM) terminates.
Henry