This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 60765
    
  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
what is the difference between local garbage collection and remote garbage collection
gc ??
i passed with 81%
Return values of methods