Rickard,
>What do you mean with "adequate DGC in Java2"? And how do weak
>references come into play, since they're VM-local?
Here is a description on how weak references help. Note: entity objects are
instances of the remote interface implementations. They should not be
confused with entity bean instances.
Let's assume that the server creates an entity object. The server has to
hold on to the object to be able to hand out references to clients. Under
jdk1.1 the server does not have any other option but to use regular (strong)
references.
After a client receives a reference to our object, it does some processing
and then releases the reference. If there is no DGC available, the client
cannot notify the server that it released the reference. Clearly the server
will not be able to reclaim our entity object.
Assuming that DGC is available, the client GC notifies the server GC that it
doesn't use our object anymore. However, the server GC still cannot release
the object since there are local references to it (remember that at
least the server is holding on to it). Hence DGC is not enough for
reclaiming our object.
Java 2 solves the problem very nicely by introducing "weak" references.
Using Java 2, the server can hold on to our object with weak references thus
not restricting the GC. Hence the GC can reclaim the object after all (both
remote and local) strong references are released.
Imre Kifor
Valto Systems
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".