Dear all, When are static variables eligible to garbage collection? thanks daniel
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Static variables are garbage collected when the class they belong to is garbage collected. Classes can only be collected when nothing refers to that class anymore. kind regards
John Wetherbie
Rancher
Joined: Apr 05, 2000
Posts: 1441
posted
0
If the static variable is being used by a number of objects then it is eligible for GC when the last object using it is GC'd.
The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.