Show TOC Start of Content Area

Function documentation Garbage Collection of Remote Objects  Locate the document in its SAP Library structure

Use

The J2EE Engine’s P4 Provider Service provides a reference-counting garbage collection mechanism that automatically removes objects that are not referenced by any clients.

Features

Note

The terms strong and weak references below are used in the sense of subclasses of the java.lang.ref.Reference class. Do not confuse these terms with the strong and weak references used to define references between the J2EE Engine components as described in the Architecture Manual.

For more information about the java.lang.ref.Reference class, see the API documentation of the java.lang.ref package at java.sun.com.

The P4 Provider Service keeps a strong reference to each remote object that has client references to it. This reference is kept as long as there are clients connected to it. When the number of clients connected to that object becomes 0, the P4 Provider Service releases the strong reference to that object and keeps only a weak reference to it. This way, the JVM can perform garbage collection of that object, since no local references exist to it.

Activities

The P4 Provider Service counts the references the following way:

·        Transmitting the object by value increases the count of the remote references to that object.

·        The count of the remote references decreases in any of the following two cases:

¡        the stub of the remote object is removed by the garbage collector of the client JVM.

¡        the connection between the client and the server, where the remote object resides, is terminated.

 

 

End of Content Area