Posted By:
Sean_Owen
Posted On:
Friday, May 28, 2004 07:58 AM
The client and server are on different machines, so there are two entirely different JVMs and Vector objects here.
On the server, a Vector is created in this method. When the method listTestFlow() finishes on the server, there will no longer be a reference to this Vector in the server's JVM, so it will eventually be garbage collected, just like anything else. There is no need to null the reference.
RMI, on the client side, constructs a new Vector just like the one on the server, from the data it receives across the network. Again, this Vector lives as long as there are references to it, and will be GC'ed eventually once there are no more. Nothing special there.
Just realize that the client's copy of the Vector, and client's references, are completely independent of those on the server.