As a general statement you don't care if an object is no longer needed. But this means that you need to be careful. Unlike C++ you don't have an explicit destructor. Therefore you need to make sure you clean up after anything like database connections before the object goes out of scope.
I guess I'm not a fan of
System.gc() - before the Java Virtual Machine throws an
OutOfMemoryException it will do everything it can to clean up memory. If you're calling
System.gc() it may help a little bit but I guess I question that it is going to do much for you. A decent Java program doesn't need to do it - know where memory is allocated and make sure you don't have references to it when youd don't want them.
greetings,
Felissa