aspose file tools*
The moose likes Beginning Java and the fly likes Garbage Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Garbage Collection" Watch "Garbage Collection" New topic
Author

Garbage Collection

Thavaselvan S
Greenhorn

Joined: Oct 30, 2006
Posts: 2
How does garbage collection happen in static variables
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

"Thavaselvan S",

Two things. First...

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Second...

Please take the time to choose the correct forum for your posts. This forum is for JSP questions. I've moved you post to a more appropriate forum.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Most objects referred-to by static variables will never be garbage collected. To be garbage collected, the class containing the static variable needs to get unloaded. That will only happen when its class loader gets garbage collected.

If the class was loaded by the system class loader (i.e. off the classpath), it will never be garbage collected, because the system class loader is never garbage collected.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Garbage Collection
 
Similar Threads
Tech Word Game
Return values of methods
i passed with 81%
gc ??
what is the difference between local garbage collection and remote garbage collection