Java CORBA server => server object GC?

Java CORBA server => server object GC?

Post by Les Hartzm » Thu, 21 Aug 1997 04:00:00



Does writing a CORBA server in Java imply that any objects that are
created on the server will automatically be garbage collected by Java?

Or is something else going on via the ORB that keeps objects from being
freed up after the client(s) go away?

TIA,

Les

--
-------------------------------------------------------------------------------

                           advantage over those who can't", Mark Twain

 
 
 

Java CORBA server => server object GC?

Post by Keith Dud » Fri, 22 Aug 1997 04:00:00



>Does writing a CORBA server in Java imply that any objects that are
>created on the server will automatically be garbage collected by Java?
>Or is something else going on via the ORB that keeps objects from being
>freed up after the client(s) go away?

This depends on a number of things. As you probably know, the Java VM
will clean up any object which is not referenced within the currently
executing set of classes. This is identical in the CORBA scenario -
however many server implementations, and some ORB mechanisms, retain
references to implementation objects regardless of whether an client
is currently using them remotely.

So in short - this depends on
        - your ORB (obj_is_ready() probably retains a reference, and
            deactivate_obj() probably releases it)

        - the mechanism you use to make your object available remotely
            (BOA/TIE/"Light Weight Callback").

It's always a good idea for the server to explicitly manage CORBA
object's life cycles by retaining reference to object instances, and
to activate and deactive them manually. However the real benefit to
CORBA programmers is not so much the life cycle of CORBA objects, but
the allocation and deallocation of arguments passed to and from the
operations of those objects. These can be just left to go out of scope
and then they are garbage collected. Compare with C++, where you need
to explicitly allocate and deallocate each block of memory, or make
the choice to assign values to _var types that will clean up for you.

K
--
__Keith Duddy___CRC for Distributed Systems Technology___+61 7 336 5 4310__

 >>> My Java ORB book is out!!  http://www.wiley.com/compbooks/vogel  <<<

 
 
 

Java CORBA server => server object GC?

Post by Blake Schol » Sat, 23 Aug 1997 04:00:00


--------------9B58665B0AEC9E50FC9121A1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Les,
    I'm not 100% positive on some of this stuff, but this is my
explanation as I best understand it.... hope it helps...

    Remember that when an a client connects to a server object, it
simply instantiates an object reference or stub.  The client talks to
the server object through that stub.  When the Java object that used the
stub is garbage collected, the stub is also garbage collected.  However,
the fate of the server object is left up to the activation policy used
to start it.  Under VisiBroker, you can have persistent, shared,
unshared, or server-per-method policies.  The persistent servers are
loaded manually; i.e. you start them at the command line.  Server
objects (not that this does not include transient objects -- they are
garbage collected when they go out of scope on the server) hang around
until some bored sysadmin decides to kill them.  The shared server works
the same way, except that the object activation daemon (VisiBroker's
OAD) will start the server whenever at least one client has bound to it,
and kill it when it isn't being used at all.  An unshared server works
the same way, except that separate processes on the server and separate
objects are instantiated for each client that binds to the server.
You've probably guessed that the server-per-method policy launches a
copy of the server each time a method is invoked.

    Anyhow, if your server is written in Java, your objects will be
garbage collected as usual.  But usually the starting-and-stopping of
your server software is handled automatically for you.

    The best way to get familiar with this functionality, particularly
in VisiBroker, is just to play around with your objects.  Start 1 client
and one server. Kill one of them or the osagent.  See how the system
behaves.  Or start a client without a server when the server is
registered with the OAD.  Watch the windows NT task manager (or similar
tool) and watch as the OAD transparently starts a copy of your server
executable.  Note that you might need to get a copy of VisiBroker 3.0
beta in order to see some of this functionality with Java.   In version
2.5, I believe, only the persistent servers are available.

Hope this helps,

Blake Scholl
DiaLogos, Incorporated -- http://www.dialogosweb.com
Specialists in Distributed Information Systems


> Does writing a CORBA server in Java imply that any objects that are
> created on the server will automatically be garbage collected by Java?

> Or is something else going on via the ORB that keeps objects from
> being
> freed up after the client(s) go away?

> TIA,

> Les

> --
> --
> ----------------------------------------------------------------------------


>                            advantage over those who can't", Mark Twain

--------------9B58665B0AEC9E50FC9121A1
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Les,
<BR>&nbsp;&nbsp;&nbsp; I'm not 100% positive on some of this stuff, but
this is my explanation as I best understand it.... hope it helps...

<P>&nbsp;&nbsp;&nbsp; Remember that when an a client connects to a server
object, it simply instantiates an <I>object reference</I> or stub.&nbsp;
The client talks to the server object through that stub.&nbsp; When the
Java object that used the stub is garbage collected, the stub is also garbage
collected.&nbsp; However, the fate of the server object is left up to the
activation policy used to start it.&nbsp; Under VisiBroker, you can have
persistent, shared, unshared, or server-per-method policies.&nbsp; The
persistent servers are loaded manually; i.e. you start them at the command
line.&nbsp; Server objects (not that this <I>does not</I> include transient
objects -- they are garbage collected when they go out of scope on the
server) hang around until some bored sysadmin decides to kill them.&nbsp;
The shared server works the same way, except that the object activation
daemon (VisiBroker's OAD) will start the server whenever at least one client
has bound to it, and kill it when it isn't being used at all.&nbsp; An
unshared server works the same way, except that separate processes on the
server and separate objects are instantiated for each client that binds
to the server.&nbsp;&nbsp; You've probably guessed that the server-per-method
policy launches a copy of the server each time a method is invoked.

<P>&nbsp;&nbsp;&nbsp; Anyhow, if your server is written in Java, your objects
will be garbage collected as usual.&nbsp; But usually the starting-and-stopping
of your server software is handled automatically for you.

<P>&nbsp;&nbsp;&nbsp; The best way to get familiar with this functionality,
particularly in VisiBroker, is just to play around with your objects.&nbsp;
Start 1 client and one server. Kill one of them or the osagent.&nbsp; See
how the system behaves.&nbsp; Or start a client without a server when the
server is registered with the OAD.&nbsp; Watch the windows NT task manager
(or similar tool) and watch as the OAD transparently starts a copy of your
server executable.&nbsp; Note that you might need to get a copy of VisiBroker
3.0 beta in order to see some of this functionality with Java.&nbsp;&nbsp;
In version 2.5, I believe, only the persistent servers are available.

<P>Hope this helps,

<P>Blake Scholl
<BR>DiaLogos, Incorporated -- <A HREF="http://www.dialogosweb.com">http://www.dialogosweb.com</A>
<BR>Specialists in Distributed Information Systems

<P>&nbsp;

<BLOCKQUOTE TYPE=CITE>Does writing a CORBA server in Java imply that any
objects that are
<BR>created on the server will automatically be garbage collected by Java?

<P>Or is something else going on via the ORB that keeps objects from being
<BR>freed up after the client(s) go away?

<P>TIA,

<P>Les

<P>--
<BR>-------------------------------------------------------------------------------

read have no
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
advantage over those who can't", Mark Twain</BLOCKQUOTE>
&nbsp;&nbsp;</HTML>

--------------9B58665B0AEC9E50FC9121A1--

 
 
 

1. client(c++)->Naming Server->server(java) ?

Hi,
I want to write my client in c++ using vbroker(ORB) and my server in
java using Orbixweb(ORB).
For the client to get the object reference I want to use a naming
service(Visigenic Naming service).
But now how can I tell to my server to register the object into the
naming service from Visigenic (Naming service in c++) ?
Do I need to write the IOR of name server object in a file and then
access this IOR from the server ?

What the different steps ?

Thant
--
Madi Hirab

2. newaliases and local host name not qualified....

3. Advice required for Java RMI client-server interface and server business object design (long post)

4. LAN2LAN NetGear RT338 CHAP problems

5. Netscape Java Applet as CORBA server object ?

6. Access times for Structs vs cells

7. IE 5.5 and Media Player 7

8. Java Corba - Destroying Server Objects?

9. omniORB3.0 Corba Server with name service <- http URL->Thirdpary Java Client

10. Launching a CORBA server from another CORBA server using Orbix

11. Java/CORBA Client & C++/CORBA server