RMI Remote reference is getting garbage collected

Hi,
I'm using Weblogic 5.1, on Windows NT.
I have RMI remote object on the server side, and my client is an applet.
In the applet I use JNDI to get the reference of the server object, and
use it. The problem is after sometime ( like 10 min or so) I get
weblogic.rmi.NoSuchObjectException
and at the WLServer console I see
' <DGCServer> tried to renew lease for 1 lost reference'.
At the server side, I bind the object using JNDI.
I want thsi reference to be available all the time in the applet.
any help is appreciated.
thanks,
Abdul.

Refer to my post on misc. Do not cross-post.
Cheers - Wei
aroshan <@cisco.com> wrote in message news:[email protected]..
Hi,
I'm using Weblogic 5.1, on Windows NT.
I have RMI remote object on the server side, and my client is an applet.
In the applet I use JNDI to get the reference of the server object, and
use it. The problem is after sometime ( like 10 min or so) I get
weblogic.rmi.NoSuchObjectException
and at the WLServer console I see
' <DGCServer> tried to renew lease for 1 lost reference'.
At the server side, I bind the object using JNDI.
I want thsi reference to be available all the time in the applet.
any help is appreciated.
thanks,
Abdul.

Similar Messages

  • Remote reference is getting garbase collected

    Hi,
    I'm using Weblogic 5.1, on Windows NT.
    I have RMI remote object on the server side, and my client is an applet.
    In the applet I use JNDI to get the reference of the server object, and
    use it. The problem is after sometime ( like 10 min or so) I get
    weblogic.rmi.NoSuchObjectException
    and at the WLServer console I see
    ' <DGCServer> tried to renew lease for 1 lost reference'.
    At the server side, I bind the object using JNDI.
    I want thsi reference to be available all the time in the applet.
    any help is appreciated.
    thanks,
    Abdul.

    thanks, I will try and let you know by tomorrow.
    I tried both methods, you suggested, but i didn't get any errors. I still
    have to test the client connections and see whether they are gc'd or not.
    i gave a idletime of 1000.
    - Sam Jacob
    Iconixx Corp.
    Wei Guan <[email protected]> wrote in message
    news:[email protected]...
    set
    weblogic.rmi.dgc.idlePeriodsUntilTimeout=xxx
    in your weblogic.properties file.
    If it didn't work (I haven't tested),
    use -Dweblogic.rmi.dgc.idlePeriodsUntilTimeout=xxx in your startup script.
    Give a try and let me know.
    Cheers - Wei
    Sam <[email protected]> wrote in message
    news:[email protected]...
    how do you set this property.I think i have the same issue.
    Sam Jacob
    Iconixx Corp.
    Wei Guan <[email protected]> wrote in message
    news:[email protected]...
    You can tune up this property:
    weblogic.rmi.dgc.idlePeriodsUntilTimeout
    The default is 2. WebLogic will dereference a remote object referece
    if
    that
    reference hasn't been referenced for a period of time. The timeout
    value
    is
    determined by this property and other properties. The default idle
    timeout
    is 360 secs when idlePeriodsUntilTimeout=2. Use this formula to figurethe
    timeout: 60 x (4 + idlePeriodsUntilTimeout).
    Use at your own risk. If you set up this value too high, there will be
    unused remote reference on WebLogic server for cleaning up, which inturn
    degrade WeLogic performance.
    My 2 cents.
    Cheers - Wei
    aroshan <@cisco.com> wrote in message
    news:[email protected]...
    Hi,
    I'm using Weblogic 5.1, on Windows NT.
    I have RMI remote object on the server side, and my client is anapplet.
    In the applet I use JNDI to get the reference of the server object,and
    use it. The problem is after sometime ( like 10 min or so) I get
    weblogic.rmi.NoSuchObjectException
    and at the WLServer console I see
    ' <DGCServer> tried to renew lease for 1 lost reference'.
    At the server side, I bind the object using JNDI.
    I want thsi reference to be available all the time in the applet.
    any help is appreciated.
    thanks,
    Abdul.

  • RMI server object getting garbage collected

    Hi all,
    I have seen a number of posts regarding the ConnectException and found that this can occur in a number of situations.
    I am having a problem here.
    I am having an RMI server that is always up and running. And the server object gets requests from the client at regular intervals. But, when the server object is not receiving any requests for a long time (ex: 1 day), then I think the remote object itself is getting garbage collected. And so, tough I am able to get the remote reference using the lookup method, I am getting "Connection refused to host: 192.168.0.216; nested exception is:
         java.net.ConnectException: Connection refused" when I call a method using this reference.
    I believe that this is because the server object getting garbage collected as there are no requests for the server since long. Please correct me if my assumption is wrong.
    I want to know, after how much time the server object gets garbage collected if no requests are received. But, my requirement is that the server object should always be available and WHENEVER a client request comes then that should be processed. What should I do to accomplish this task.
    If any one have any suggestions, please reply as soon as possible.
    Thanks in advance,
    srik4u

    You might do some research into using an activatable remote object. You run rmid (the rmi activation deamon) and register a subclass of java.rmi.activation.Activatable (instead of the usual UnicastRemoteObject) with it. With an activatable object, the remote reference to the activatable object doesn't need to have a live object behind it. If an activatable object is not running (ie: it hasn't been constructed yet, or it has been garbage collected ...as in your case) a remote reference to the object can still be exported to a client. The first time the client calls a method on the remote object, the activation service on the server sees the object is not active, and activates the object for the client. If the object is running ...it is rmi as usual. But if it gets gc'd again, the next invocation on the remote object will trigger the activation service again.
    (The above explanation paraphrases author David Flanagan from Java Enterprise in a Nutshell, O'Reilly)
    I have only built one of these, which loosely followed an example from the above mentioned book. It's a whole other ballgame over and above a regular rmi object. But like anything else, if you dig in and get your head wrapped around it, it eventually makes sense. Ok, why lie ...it confused the hell out of me and left me a little queasy. But you know the drill, by the time you build a few of them it will probably seem as easy as mapping the human genome, right? At any rate, it seems like what you might be after ...so have a look at it. Good luck, and wear your lifejacket.

  • Entity Beans not getting garbage collected

    Hi,
    I am developing an application that is using EJBs utilizing several common design patterns (i.e. Session Facade, DAO, and Fast Lane Reader). All of the patterns used have come from books by Sun Microsystems Press.
    As I have understood the pattern, the Session Facade pattern uses Stateless Session Beans (SLSB) to implement a desired functionality and accesses the entity beans locally. The results from the entity beans are placed into Value Objects and passed back to the client separating any direct access with the entity beans from the client. In my case, I am using BMP for my entity beans.
    The problem I am seeing with Optimizeit is that none of my entity beans are getting garbage collected despite no references to them. The SLSB creates what entities it needs to perform a task at the local level, puts the data into a value object and goes out of scope.
    Shouldn't the entity beans get removed if the object that references them has gone away or am I missing something?
    Is there a proper way to set an entity bean (or any EJB for that matter) for garbage collection.
    thanks in advance for any help...

    You might even discover that entity beans can get created even before you use them.
    Your application server creates "pools" of bean instances that it can use when it needs to. It is part of this role, and is done in order to optimize performances.
    You cannot force them to be garbage collected. Even if you stop referencing them, the app server will.
    When your create references to a bean, it (usually) won't create an instance. It will take an existing one, and load data into it, using ejbCreate or ejbActivate.
    Hope this helps.
    /Stephane

  • A question about JNI references, persistence, and garbage collection

    I am writing a library to allow our Java developers to access C functions in our product. I want people on the Java side to be able to instantiate instances of a new object (on the C side), say "Map", and I want those objects to persist until they are destroyed on the Java side. I am thinking of creating a wrapper for the native methods, which stores an identifier for the instance of an object. When the C object is accessed, the identifier is passed to the C code which looks up the correct object in a table. I understand that if I use the NewGlobalReference call in JNI I can get objects to persist.
    When it is time for garbage collection I plan to override finalize() to call the C code and tell it to remove the Global Reference.
    Here's what I have in mind
    public class JMap() {
         private static int id;
         static {
              System.loadLibrary("libMap");
              /*Call C method which instantiates object and creates a GlobalReference
              which is stored in table. Returns ID for reference*/
              id = _init();
         public void setSize(int x, int y) {
              _setSize(id, x, y);
         public void finalize() {
              _finalize(id);
              super.finalize();
         private native int _init();
         /*calls DeleteGlobalReference for the reference matching this id*/
         private native void _finalize(int id);
         private native void _setSize(int id, int x, int y);
    }Is this the right thing to do? Have I understood the way JNI works with regard to GlobalReferences?
    Any comments, tips or pointers would be appreciated :)

    This probably should have been posted in the Native Methods sub-forum, I have reposted there:
    http://forum.java.sun.com/thread.jspa?threadID=657667
    Mods please delete this post :)

  • Rmi remote reference lookup very slow in web start application

    I have a little problem with the RMI communication in a web start test application.
    It is a very simple program in which the client calls a remote object that returns a String.
    Everything seems to be working fine when i'm running/debugging the client app in eclipse, but when i package my client project into a jar file and run it as a web start application (i'm providing the jnlp on a local webserver) the remote reference lookup takes about 15 seconds.
    basically, what my client does is this:
    Registry registry = LocateRegistry.getRegistry(address);
    ServerTransaction st= (ServerTransaction) registry.lookup(name);
    String result = st.test();
    The server code looks like this:
    String name = "ServerTransaction";
    ServerTransaction engine = new DefaultServerTransaction();
    ServerTransaction stub = (ServerTransaction) UnicastRemoteObject.exportObject(engine, 0);
    Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
    registry.rebind(name, stub);
    The server runs as a normal stand alone java application on my local machine as well.
    And here the content of the jnlp file for the client application:
    <resources>
         <jar href="WSTest.jar"/>
         <jar href="WSTestServer.jar"/>
         <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
         <property name="serverAddress" value="127.0.0.1" />
    </resources>
    <security>
         <all-permissions/>
    </security>
    <application-desc main-class="test.WSTest"/>
    As i said, the whole thing works when run as a normal java application as well as with web start, with the difference that the remote reference lookup takes about 15 seconds with web start.
    Can anyone tell me how i could go about this?

    Meanwhile, i tried the same thing at home on my xp machine (i use vista at work), and even though my test at home basically does the same thing (invoking a simple remote method that just returns "hello world") it worked pretty fast, contary to the 15 second hang on vista.
    So i can't really say where the problem is...
    I also found these two rmi properties
    sun.rmi.transport.connectionTimeout (1.1.6 and later)
    The value of this property represents the period (in milliseconds) for which socket connections may reside in an "unused" state, before the Java RMI runtime will allow those connections to be freed (closed). The default value is 15000 milliseconds (15 seconds).
    and
    sun.rmi.transport.proxy.connectTimeout (1.1 and later)
    The value of this property represents the maximum length of time (in milliseconds) that the Java RMI runtime will wait for a connection attempt (createSocket) to complete, before attempting to contact the server using HTTP. This property is only used when the http.proxyHost property is set and the value of java.rmi.server.disableHttp is false. The default value is 15000 milliseconds (15 seconds).
    Hoping it would help (totally clueless) i tried to set these as system properties via System.setProperty(...) to a lower value (if that even works this was - please correct me if i am totally wrong here) but it didn't help.

  • Find out references to objects (garbage collection)

    Is there an easy way to find out, which references prevent the garbage collector from collecting my old objects, which I expect should be collected? Something like System.out.println(...)

    if you just want an object to be garbage collected, just
    make sure you de-reference is completely.CMueller obviously doesn't know which references prevent garbage collection so naturally he cannot set those references to null, now can he?
    o = null; // sets the value to null and drops all the referencesThat is simply not true. Removing a reference to an object doesn't affect any other references to that object.
      Object o1,o2;
      //create an object and make o1 reference it
      o1=new Object();
      //make o2 reference the same object as o1 references
      o2=o1;
      //now there are two references to the object
      //make o1 reference null
      o1=null;
      //at this point there is still one reference (o2) to
      //the object and therefore the object is NOT garbage
      //which means that it can NOT be collected by the GC- Marcus Sundman

  • Nested object reference after garbage collection

    I have a question about how GC works.
    Assume I have a Class A which has a reference to class B inside it. I create a object of class B and assign to member variable of class A.
    Now when obja is no longer needed, I set it null. And when GC runs, the object will be removed from memory. But should I also need to explicitly set objb to null. If i don't set it, will it also get garbage collected when obja is being removed from memory?
    public class ClassA {
    private ClassB objB = new ClassB();
    private static void main(String args[]) {
    ClassA obja = new ClassA();
    obja = null;
    }

    801625 wrote:
    But should I also need to explicitly set objb to null.No.
    If i don't set it, will it also get garbage collected when obja is being removed from memory?If there are no other references outside of classA to the object referenced by objB (in your case an instance of ClassB) then it will be garbage collected.
    Note - the only time one needs to set a reference to null is if one wants the object it references to be eligible for GC before the reference goes out of scope. There is a slight complication to this - depending on the JVM implementation, if a reference is defined in a block internal to a method then even though it goes out of scope when execution goes out of the block anything it references may not be eligible for GC until the method exits.

  • Array garbage collection

    I need to keep track of what objects got garbage collected in a program.
    So I made sure that the classes of interest have a 'finalize()' method that simply print out the toString() and reference of the garbage collected object (using System.identityHashCode(this)).
    This worked fine for all objects except arrays.
    I went as far as substituting my own version of java.lang.Object that has an appropriate finalize(), but still no finalize() method seem to be getting called when an array object is 'supposed' to be garbage collected (the process consumes most of the system memory...)
    Any thoughts?
    Thanks,
    Wes

    Just an idea. You can try using WeakReference. Rather than using finalize, you can use the clear method of Reference.
    Here is some pseudo code
    .. class GCWatcher{
    List wrl = ...
    public void watch(Object obj){
    wrl.add(new WatchableWeakReference(obj));
    .. class WatchableWeakReference{
    WathableWeakReference(Object obj){
    super(obj);
    public void clear(){
    wrl.remove(this);
    Object obj = get();
    print out your message
    super.clear();
    If you try it let me know if it worked.

  • Frame Garbage Collection

    Hey, I'm wandering when Frames get garbage collected....i.e. if i create a reference to a new frame....do stuff with it (including setVisible), then change that reference to another new frame, what happens to that old frame object? Theres no references to it, but its still being displayed on screen.......is it garbage collected?
    Cheers,
    Siam

    So what'll that mean if the frame is still visible on screen? Will it just disappear? I've removed all references I made to it, but doesnt the fact that its still being displayed mean that theres some other internal references to it?

  • Distributed Garbage Collection doesn't work on WL 5.1 SP4

    Hi,
    we are running WL 5.1 SP4. We pass RMI remote references to a
    client. The implementation of the references implement the
    java.rmi.server.Unreferenced interface but we never see the
    unreferenced method of the objects being called.
    We passed thousands of objects to the client an set all
    references to null.
    Neither does the unreferenced method get called when the
    client shuts down.
    Not even the finalize method of the objects is being called.
    Any suggestions.
    Regards
    Gerd
    Gerd Wagner mailto:[email protected]
    SHD Datentechnik GmbH & Co. KG fax :(49)2632/295-269
    Rennweg 60 phone :(49)2632/295-0
    D-56626 Andernach WWW :http://www.shd.de

    Hi,
    we are running WL 5.1 SP4. We pass RMI remote references to a
    client. The implementation of the references implement the
    java.rmi.server.Unreferenced interface but we never see the
    unreferenced method of the objects being called.
    We passed thousands of objects to the client an set all
    references to null.
    Neither does the unreferenced method get called when the
    client shuts down.
    Not even the finalize method of the objects is being called.
    Any suggestions.
    Regards
    Gerd
    Gerd Wagner mailto:[email protected]
    SHD Datentechnik GmbH & Co. KG fax :(49)2632/295-269
    Rennweg 60 phone :(49)2632/295-0
    D-56626 Andernach WWW :http://www.shd.de

  • Garbage collecting threads

    I am doing the following:
    public class MyClass {
         private Thread t = null;
         public class testThread extends Thread{
           public void run(){
                  String logName = this.getClass().getName();
                  Logger.Print( logName );  // Basically prints logName to file
                  for( int i = 1; i<4; i++){
                         try{
                           Thread.sleep(100)
                           [do stuff]
                           Thread.sleep(100);
                         catch(InterruptedException e) { }
           public callThread(){
               if ( t != null ){
                        if( !(t.isAlive()){
                               t = new TestThread();
                               t.start();
               else{
                               t = new TestThread();
                               t.start();
    } What, I want to happen is a thread to finish and after that a new one to start, and once the old thread does not have any variable assoiciated to it anymore, it should get garbage collected as far as my java understnading goes, this is exactly what should happen, in duo time whenever the garabage collecter decides so. This is a very long time running program.
    And the log shows the names of the threads like Thread-1 , Thread-2, Thread-3 , Thread-4, basically this name is increased by one everytime the function callThread is called and the old thread finished running, is there a limit to how many times I can call it like if it is called 10 billion times, will I have Thread-10000000000 in my log? and will the garbage collection work as I think? I am a c++ programmer so I do not trust it 100%, I really feel like adding delete t; so I can feel confident it is really gone before I do a t = new TestThread(); hehe C++ sickness??
    Please give me advice on this!!! and I will be very happy!
    Edited by: dakiar on Mar 19, 2008 8:18 AM

    dakiar wrote:
    What, I want to happen is a thread to finish and after that a new one to start,Use join(), rather than looping and checking isAlive, in order to determine when a thread has died.
    while (true) {
      Runnable r = new MyRunnable(); // You have no reason to extend Thread. It's preferable to implement runnable.
      Thread t = new Thread(r);
      t.start();
      t.join();
    and once the old thread does not have any variable assoiciated to it anymore, it should get garbage collected as far as my java understnading goes,It will become eligible for GC. There's no guarantee when or even if it will actually be GCed, other than that GC will at least happen before OutOfMemoryError.
    And the log shows the names of the threads like Thread-1 , Thread-2, Thread-3 , Thread-4, basically this name is increased by one everytime the function callThread is called and the old thread finished running, is there a limit to how many times I can call it No.
    like if it is called 10 billion times, will I have Thread-10000000000 in my log? Perahps. Or if Thread uses an int then it might wrap around to Integer.MIN_VALUE and give Thread--2147483648.
    You know you can assign your own names to the Threads.
    and will the garbage collection work as I think? It will work fine, and that has nothing to do with thread names.
    I am a c++ programmer so I do not trust it 100%,So, you think that you managing memory ad-hoc in every program you write when you're trying to focus on implementing the business requirements of your app will be better at it than the guys who were specifically focussed on writing memory management that would be handled consisently by the computer, and has been continuously refined, not to mention tested by thousands of Java developers over the last dozen or so years?
    I really feel like adding delete t; You can't and you don't need to.

  • Avoiding Garbage Collection

    Hi,
    Does anyone know of a general design pattern that allows an object to remain
    in memory without being garbage collected ? I'm not clear whether or not
    the singleton pattern fulfills this requirement. I basically want to have a
    Global constants class (constants are loaded from a properties file) that
    remains in memory so that it can be used by various components. The
    constants are loaded from a properties file initialially. So if that class
    gets garbage collected, then the next time that class is accessed, it will
    have to reload from the props file. This is a performance issue, and I
    would like to find a solution around it.
    I will probably want to have other services such as a LoggingService,
    JNDIService that I want started up, and for it to remain in memory. I know
    you can register startup classes with WL, but do those classes remain in
    memory ?
    I'm been trying to find an answer to these questions. Hopefully someone
    will have them.
    Thanks.

    One way to do it is to bind your constants class into JNDI during
    start-up.
    -- Rob
    Jamie Tsao wrote:
    >
    Hi,
    Does anyone know of a general design pattern that allows an object to remain
    in memory without being garbage collected ? I'm not clear whether or not
    the singleton pattern fulfills this requirement. I basically want to have a
    Global constants class (constants are loaded from a properties file) that
    remains in memory so that it can be used by various components. The
    constants are loaded from a properties file initialially. So if that class
    gets garbage collected, then the next time that class is accessed, it will
    have to reload from the props file. This is a performance issue, and I
    would like to find a solution around it.
    I will probably want to have other services such as a LoggingService,
    JNDIService that I want started up, and for it to remain in memory. I know
    you can register startup classes with WL, but do those classes remain in
    memory ?
    I'm been trying to find an answer to these questions. Hopefully someone
    will have them.
    Thanks.--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • Premature Garbage Collection of Remote Objects

    I have a problem with distributed garbage collection and RMI. In CSPoker we try to support RMI for client-server communication. The client looks up the server through the registry, calls the login method and receives back a Remote Object reference called ServerContext. The client can register Remote even listener Objects with the server.
    In both directions we occasionally see:
    java.rmi.NoSuchObjectException: no such object in table
    The behaviour is completely unpredictable. Some developers never see it, others see it all the time. Even on the same machine, sometimes it failes immediately
    and sometimes it fails after a while. One person running the Sun JRE 6 on Windows has this poblem most frequently.
    Can this be a bug or do we misinterpret something? The way we see it, as long as the client leases the Remote Object it shouldn't be GCed. All tests are run on localhost so no network partition can occur.
    The problem would probably be solved if we hold static references to all Remote Objects in the local JVM. This is not an option because we want the Objects to be GCed once the lease expires.
    Here are 2 debugging outputs of server runs with RMI logging enabled:
    http://cspoker.pastebin.com/f27a7d6fc
    As you can see, the lease requests are coming through but a NoSuchObjectException is thrown and the Object is finalized.
    http://cspoker.pastebin.com/f732797d2

    Thanks for the quick reply.
    For instance:
    11:56:02,427 DEBUG (org.cspoker.common.api.shared.context.ForwardingRemoteServerContext.java:72) [finalize] - Garbage collecting old context: org.cspoker.server.rmi.export.ExportingServerContext@15a8767
    07.11.2008 11:56:02 sun.rmi.server.UnicastServerRef logCall
    FEINER: RMI TCP Connection(2)-10.0.4.106: [10.0.4.106: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    07.11.2008 11:56:03 sun.rmi.transport.Transport serviceCall
    FEIN: RMI TCP Connection(2)-10.0.4.106: [10.0.4.106] exception:
    java.rmi.NoSuchObjectException: no such object in table
            at sun.rmi.transport.Transport.serviceCall(Transport.java:129)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
            at java.lang.Thread.run(Thread.java:595)The context Object is exported and returned to the client here :
    return (ExternalRemoteServerContext) UnicastRemoteObject.exportObject(context, 0);Then [the object|http://code.google.com/p/cspoker/source/browse/trunk/server/rmi/src/main/java/org/cspoker/server/rmi/export/ExportingServerContext.java?r=1023] that was just exported is GCed.
    11:56:02,427 DEBUG (org.cspoker.common.api.shared.context.ForwardingRemoteServerContext.java:72) [finalize] - Garbage collecting old context: org.cspoker.server.rmi.export.ExportingServerContext@15a8767Then a lease request comes in:
    FEINER: RMI TCP Connection(2)-10.0.4.106: [10.0.4.106: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]Then the client calls a method on the remote object and the NoSuchObjectException is thrown.
    The behaviour is non-deterministic in any case but yes, on the Linux JVM I'm not seeing the problem, somebody on Windows gets it all the time.

  • Disabling RMI Explicit Garbage Collection

    I have an application that uses RMI. From different articles on the javasoft web site, I have read that RMI explicitly does a Full RMI every minute (default setting). This is undesirable, b/c these full GCs are causing some objects I need to use later to be garbage collected. From the site, the options are to:
    1) Disable Full GC
    2) Delay Full GC
    For point 1), what are the consequences of disabling explicit full GCing that RMI does? Documentation on the javasoft website only says that "this may also cause some objects to take much longer to be reclaimed" etc. To me, I would think that disabling the explicit Full GC is a bad idea for RMI applications (unless they are really short lived, but that is not my case). It would seem safer to go with 2) option to delay the Full GCs since it's not entirely clear what the consequences are of completey disabling explicit GCs, but this still causes objects I still need to use later to be garbage collected. The last option which I feel is not very elegant, would be to just set something to reference or use that object that is being gc'ed so when a Full GC is performed it doesn't get cleaned up. Does anyone have any experience with this or have any better suggestions?
    I am using Java 1.4.2 currently, but am also interested in learning what would be good for Java 1.2.X and 1.3.X as well.
    Thanks!
    These are the links that I have already visited or docs that I have already read on this topic:
    1) Java 2 Platform, Standard Edition v 1.4 Performance and Scalability Guide
    http://java.sun.com/j2se/1.4/performance.guide.html
    2) Frequently Asked Questions about Garbage Collection in the HotspotTM JavaTM Virtual Machine
    http://java.sun.com/docs/hotspot/gc1.4.2/faq.html
    3) Improving Java Application Performance and Scalability by Reducing Garbage Collection Times and Sizing Memory Using JDK 1.4.1
    http://developers.sun.com/techtopics/mobility/midp/articles/garbagecollection2/#11.1.3.15
    4) Garbage Collection for Remote Objects (1.4.2)
    http://java.sun.com/j2se/1.4.2/docs/guide/rmi/spec/rmi-arch4.html

    Towards the end of my pot I wrote:
    The last option which I feel is not very elegant, would be to just set something to reference or use that object that is being gc'ed so when a Full GC is performed it doesn't get cleaned up. Does anyone have any experience with this or have any better suggestions?
    I realize that I can reference these objects, but I don't think that is really a great solution. This would mean deliberately referencing them (a hack at a solution in my view) when really it's the explicity GC running every minute (b/c of RMI) that is collecting them. If I turn the explicit GC off, my objects are not collected like this.
    My question was really does anyone have any better ideas or experience with RMI's explicit garbage collecting? I don't need to read a tutorial to tell me how to keep my objects alive by referencing them. Thanks.

Maybe you are looking for