So, let's say I have a bean with a whole bunch of fields/variables/objects in it.  You 
know, like some strings, some ResultSets (very short lived), some ints,  etc.  Ok, so 
I finish with my bean.  I don't need it anymore.  So, I remove it from the session 
(where it lives) and null it out (searBean = null;).  Hopefully it, at least, can now 
be garbage collected;  what about all the little objects that used to live inside of 
it?  Are they now garbage?  Or do I need to null them each out?  I suppose I could 
have a method cleanUp() or something that would simply null out each object within the 
bean and call that right before I was done with the bean, but I'm still curious.  
Also, for request scoped beans, presumably they're garbage nearly immediately (i.e., 
right after the request is over).  Do I have to null out they're objects to make them 
garbage?  

Ok... enough babbling for now.

Michael Nicholson,
Carolina Center for Public Service

Reply via email to