Full GC for RMI Distributed Garbage Collection: when does one need it?

Hi all,
as RMI DGC seems to initiate a full GC every minute (1.3.1_08 VM on Solaris), I guess that many
people resort to -XX:+DisableExplicitGC to get rid of those full GCs.
Now I wonder: why does RMI DGC call System.gc() anyway? Or, the other way round, when is it a bad
idea to disable those explicit GCs? What would a system look like where those explicit GCs are
absolutely needed?
Thanks for any enlightenment on the subject,
Jörg.

See here for an explanation of other properties you can set, plus a bit about leasing
and why a GC is needed. If you're not using remote objects from another server,
you don't need it.
http://java.sun.com/j2se/1.4.2/docs/guide/rmi/sunrmiproperties.html
Note that a System.gc() doesn't always result in a full gc.
simon.
=?ISO-8859-1?Q?J=F6rg_von_Frantzius?= wrote:
Hi all,
as RMI DGC seems to initiate a full GC every minute (1.3.1_08 VM on Solaris),
I guess that many
people resort to -XX:+DisableExplicitGC to get rid of those full GCs.
Now I wonder: why does RMI DGC call System.gc() anyway? Or, the other
way round, when is it a bad
idea to disable those explicit GCs? What would a system look like where
those explicit GCs are
absolutely needed?
Thanks for any enlightenment on the subject,
Jörg.

Similar Messages

  • You but should be when I have scurrty cood can not close the I phone should be when I need close phone I but scurty cood for can I close my phone it is biter for can't any one close phone directly  When I have program for fined my I phone when any one clo

    you but should be when I have scurrty cood can not close the I phone should be when I need close phone I but scurty cood for can I close my phone it is biter for can't any one close phone directly
    When I have program for fined my I phone when any one close phone no have internet can't find my phone agine

    It is biter for any thief take my phone can't close my phone when he close my phone can't found agine because I open 3G when thife close my phone it is finsh can't yousing program for find my I phone
    Plz back to think my point it is biter for can't lose phone
    Should be when I need close the iPhone when I have scurty cood should be when I close I but scurty cood agine
    Thank  you very mutsh

  • For my ipad to recieve imessages does it need the same ID as my Itunes and facetime?

    for my ipad to recieve imessages does it need the same ID as my Itunes and facetime

    See:
    http://support.apple.com/kb/HT3529
    This is the iPhone forum, by the way.
    Regards.

  • 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.

  • Very slow garbage collection when overriding finalize

    I am working on a 3D visualization program, and smooth animation is very important; long pauses for GC is unacceptable.
    GC is normally very fast, but when I tried to override finalize() to do some necessary cleanup this is no longer the case. I wrote a simple test application to verify this behaviour (included below), and ran it with java -verbose:gc.
    Here is the output when commenting out finalize():
    [GC 511K->248K(1984K), 0.0035095 secs]
    [GC 760K->265K(1984K), 0.0016098 secs]
    [GC 777K->265K(1984K), 0.0010843 secs]
    [GC 777K->265K(1984K), 0.0009727 secs]
    [GC 777K->265K(1984K), 0.0006170 secs]
    [GC 777K->265K(1984K), 0.0005789 secs]
    [GC 777K->265K(1984K), 0.0005970 secs]
    [GC 777K->265K(1984K), 0.0006351 secs]
    And here is the same when overriding finalize():
    [GC 511K->285K(1984K), 0.0042582 secs]
    [GC 797K->797K(1984K), 0.0120764 secs]
    [GC 1309K->1260K(1984K), 0.0106945 secs]
    [GC 1772K->1772K(2368K), 0.0124083 secs]
    [Full GC 1772K->900K(2368K), 0.0306330 secs]
    [GC 1412K->1412K(2080K), 0.0106363 secs]
    [GC 1924K->1920K(2464K), 0.0111980 secs]
    [Full GC 1920K->908K(2464K), 0.0318079 secs]
    Can someone explain what is going on? I assume Java is doing quite a lot of work just in order to run my finalize, but this seems a bit much; the GC time is two orders of magnitude slower!
    I am running SUN Java 1.4 under Linux.
    My test application:
    class C
        int i;
        int[] a = new int[20];
        public C(int i)
            this.i = i;
            for (int j=0; j<a.length; j++) a[j] = i*j;
        protected void finalize() {
            if (i > 200) return;
    class gctest
        public static void main(String[] args)
            C[] c = new C[500];
            for (int i=0; i < 100000; i++) {
                c[i%c.length] = new C(i);
                long l = System.currentTimeMillis()+1;
                while (System.currentTimeMillis() < l);
    }Thanks.
    Kristian Eide

    Let me keep it simple. gussev is correct.
    Do NOT use finalize. I don't know what that other poster read that suggested in rare cases finalize is needed. Finalize can never be usefull for anything but hints at when your class has been "finalized."
    You must use something from the java.lang.ref package. It has been said that finalize is not guaranteed to run. For you I am assuming it means a memory leak. If it does not mean a memory leak because when the java process is done, the c++ process will always be done too, then you can use finalize, but its not recommended. Yes, when your object has a finalize method defined, it will delay its collection. Normally if their is no finalize method the GC will just collect the object, but if their is a finalize, the GC has to consider that this may take time, so it can postpone GC until it feels it has time, or it has no choice. looking at your output and the addition of the word "Full GC" to the second set, I am assuming the GC has postponed as long as it can and when it finally runs, its collecting a nice size set of objects.
    Suck it up, bite the bullet, take courage, do what you gotta do, etc. etc... Forget about finalize :D I think a WeakReference is likely most appropriate for your application. You may need to make your own thread that cleans up these objects though, and give it a lower priority than your drawing thread. In essence you will be determining when finalize is run so to speak as opposed to letting the GC, and you are smarter than the GC, or at least thats the idea :)
    This should get you started
    http://developer.java.sun.com/developer/technicalArticles/ALT/RefObj/

  • 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

  • Does not play correct ringtones that are set for the Caller and Rings when no one is calling

    I have had my Droid Global for around and three months and from the beginning I have had issues with the ringtones ringing when a certain person calls me. Instead, it seems, it will play the rigntone that is applied to the last person that called me instead of the person who is actually calling me.  This can be somewhat frustrating and kind of defeats the purpose of applying rigntones to people in the first place.
    Also, just recently my phone has decided to ring all by itself...without any incoming calls, notifications...nothing. It does a very quiet ring that sounds similar to that of a house telephone or landline phone. It does not stop unless someone calls me or if I take my battery out and reset my whole phone.  My phone has only done this twice and unfortunately it once happened in one of my college classes and I couldn't get it to stop.
    Please help me...I don't know what I can do to fix this!!!

        Hi Cargo23,
    I am sorry to hear you're having issues with your phone not ringing. In what zip code were you located when this issue occurred?  Are you using your vehicle's bluetooth when this happens? Please try a soft reset to refresh your connections http://vz.to/1nLXk5g.
    Thank you!
    EdW_VZW
    Follow us on twitter @VZWSupport

  • When does LIBPATH need to be set for an Oracle RDBMS running on AIX?

    I am trying to determine the impacts of not having LIBPATH set in an AIX 5.3 environment running Oracle 10.2.0.4 64 bit databases. It would appear these databases may have been ported from Linux and the LD_LIBRARY_PATH variable was set in some of the scripts (i.e. Cold backup that shutsdown and starts the database).
    My interpretation from research is LD_LIBRARY_PATH would be ignored by AIX, although some hits I have found show this envionment variable set and LIBPATH. If LIBPATH is not set for database scripts (i.e. shutdown/startup for backup, database maintenance, etc) is there any concern? LIPBPATH is not set in the .profile for the oracle account either.

    908340 wrote:
    I am trying to determine the impacts of not having LIBPATH set in an AIX 5.3 environment running Oracle 10.2.0.4 64 bit databases. It would appear these databases may have been ported from Linux and the LD_LIBRARY_PATH variable was set in some of the scripts (i.e. Cold backup that shutsdown and starts the database).
    My interpretation from research is LD_LIBRARY_PATH would be ignored by AIX, although some hits I have found show this envionment variable set and LIBPATH. If LIBPATH is not set for database scripts (i.e. shutdown/startup for backup, database maintenance, etc) is there any concern? I am not concerned.

  • Messages contact: why is it telling me for some contact not registered when same ones have no problem on IPhone.  Cannot send those messages from Pad

    Contact not registered, what is the problem?

    Pitounette62 wrote:
    This does not solve the problem.  I could do those before, text messages from IPad, can to some contacts and now having updated to IOS it has a problem.  Not the only one with this problem.  Your solution is?
    Who are these people that you could send messages form your iPad to before?
    Do they have iPhones or iPads?
    Have they setup Messages on their devices?

  • Problems with email set-up option 2 selected when option one needed ie add an email personal

    Hello All,
    My new 8520 arrived yesterday, I ask my daughter to set it up for me as she has one. Everything was going ok until I think she pressed the option for email as if I had a work email address which i dont i think option one should have been pressed ie add new email/personal home user email. I cannot seem to get back to that option all I get is has your blackberry admin given user name/number etc.
    Also on the setup box the only icons I have are set-up wizard set up wi-fi and set up bluetooth. Can anyone help me out please, do I need to reset-phone to factory settings or something??
    Thanks
    Jason

    Hi and Welcome to the Forums!
    Please do this:
    Anytime random strange behavior or sluggishness creeps in, the first thing to do is a battery pop reboot. With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes. See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    After the boot-up, you should be able to again freshly launch the email setup wizard. If you are only presented with Enterprise, then you need to contact your carrier to ensure that you have the proper data account on your BB to enable the services you desire:
    http://www.blackberryfaq.com/index.php/What_do_I_need_a_Data_Plan_for%3F
    Best!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I have an unlimited data plan, with Sprint, for my iphone 4. How does one set up a personal wi-fi hotspot?

    I have an unlimited data plan, with Sprint, for my iPhone 4. How do I set up a personal wi-fi hotspot?

    follow the link
    http://support.apple.com/kb/HT4517

  • [scjp exam] garbage collection questions

    can someone please post me some garbage collection questions + correct answers, because i've taken the SCJP test again and i didn't passed it again. A co-worker of mine also didn't passed either.
    (We both got 0% on Garbage Collection every time) And i really thought i had it correct the last time.
    So please can someone mail/post me some garbage collection questions? thanks!

    The garbage collector collects unreachable objects.
    You have no control over when the objects are
    collected, but there is a guarantee that all
    unreachable objects will be collected before an
    OutOfMemoryError is thorwn.Exactly my thoughts...
    That's it. It really is just that simple. I scored 94%
    on the Programmer's Exam, with 100% in the garbage
    collection section.Hmm i got 54% last exam i took. I really begin to doubt about myself, because i find the questions on the exam so tricky.. Last book was Exam Cram (Java), and i found this a very nice and good book to study for the exam. Garbage collection is just one question, so it's either 0% or 100%. So far it hasn't gone anything higher then 0% with me.
    Here are some questions:
    1. When is the Object first available for garbage
    collection (when does it become unreachable)?
    Object o = new Object();
    Object p = o;
    o = null;
    p = null;p = null; -> available for gc.
    2. When is the Object first available for garbage
    collection?
    Object o = new Object();
    Vector v = new Vector();
    v.add(o);
    o = null;
    v = null;v = null; -> available for gc.
    3. Can the Vectors be garbage collected at the end of
    this code?
    Vector v = new Vector();
    Vector w = new Vector();
    v.add(w);
    w.add(v);
    v = null;
    w = null;yes
    Now i have a question:
    public int foo {
    Integer result = new Integer(10);
    result = null;
    return result;
    when is result available for gc?

  • Full garbage collection issue, not releasing/flagging memory

    I have the following problem running on a multi-cpu windows server with Java 1.4.2_05 using WebLogic 8.1:
    During a lifecyle of the web application (under load, but not to heavy) memory usage seems ok and garbage collection is called regularly. Suddenly, the used heap starts to rize very fast and after a while, even a full garbage collection cylce, does not release any memory anymore.
    I am sure that, from our coding, we release memory ok, and normally we should only use about 5 to 10 mb for each user max (with0 normal defnew garbage collections).
    I tried changing the garbage collection parameters, but this does not solve the problem. Best scenario was with the concurrent collector and I got this output at +/- the end:
    [GC 100202K->93511K(115628K), 0.0091472 secs]
    [GC 148480K->139612K(163808K), 0.0225914 secs]
    [Full GC[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor289]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor290]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor273]
    153750K->133006K(164064K), 1.2434402 secs]
    [GC 148939K->137948K(203264K), 0.0223085 secs]
    [GC 188789K->177116K(203264K), 0.0180729 secs]
    [Full GC[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor312]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor322]
    [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor309]
    189788K->170264K(203264K), 1.1851945 secs]
    [Full GC 203228K->203227K(203264K), 1.2876122 secs]
    [Full GC 203263K->203233K(203264K), 1.3354548 secs]
    [Full GC 203263K->203258K(203264K), 1.2873518 secs]
    <Jan 17, 2007 9:40:40 AM EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=33114655,name=console,context-path=/console)] Root cause of ServletException.
    java.lang.OutOfMemoryError
    >
    [Full GC 203263K->203233K(203264K), 1.2814516 secs]
    [Full GC 203233K->203231K(203264K), 1.6029044 secs]
    [Full GC 203263K->203242K(203264K), 1.3081352 secs]
    <Jan 17, 2007 9:41:51 AM EST> <Emergency> <WebLogicServer> <BEA-000210> <The WebLogic Server is no longer listening for connections.>
    [Full GC 203263K->203247K(203264K), 1.3161194 secs]
    [Full GC 203263K->203249K(203264K), 1.2954988 secs]
    [Full GC 203263K->203247K(203264K), 1.6423404 secs]
    <Jan 17, 2007 9:41:57 AM EST> <Alert> <WebLogicServer> <BEA-000218> <Server shutdown has been requested by <WLS Kernel>>
    [Full GC 203263K->203250K(203264K), 1.3161025 secs]
    Another strange item is: I maximized the amount of memory it uses to 512m with the Xmx parameter, I am almost sure that that one is used, but it never gets higher than 203M? Does anyone know why this is?
    Another strange item: the monitoring in the weblogic code indicates 32MB of usage (relative memory usage seems to be ok, but the quanity indication is just plain wrong) with 15 threads running.
    This problem does not exist when using JBoss 4.0.2 or 4.0.3 (standard j2ee settings).
    If anyone has an idea or can help me, I would appreciate it very very much. :)

    Hi ,
    Is this issue resolved ?
    we are facing same problem.
    1. We have checked the CPU and memory utilization everything is normal
    2. GC logs showing FULL GC calls continuously
    3. After restart the resin server system is working normally.
    Environment detail
    Resin ./resin-pro-3.0.18 on suse Linux
    Java JDK1.4.2_08
    Please suggest

  • When does garbage collection occur?

    Answer the question!
    thanks

    Sometime after a objects become unreachable and before the memory allocator runs out of memory, the garbage collector will run. You have no way of controlling or knowing when that will be. There is no reason to.
    For some reason, even though many programming languages have garbage collection, people seem to regard Java's garbage collection as something they need to "understand" and control. Garbage collection is best left up to the garbage collector -- that's its job, and just let it work.

  • Elligible for Garbage Collection

    If an object is unreferenced, but it does not declare a finalize() method, then is this object elligible to be finalized and freed by Gc?
    Regards
    JS

    Thanks for the prompt reply.
    JVM Specification says an object can be garbage collected when it is unreferenced.Thus that mean that setting an object to null can not make it elligible since some other objects may still refer the object in question?
    JS

Maybe you are looking for

  • Acrobat XI Pro Installation Issues

    Hello , I tried installing Acrobat XI Pro and its not installing for me too . Please help us . 1. OS : Win7 , 64 bit 2. Setup file through adobe website 3. It freezez almost at the end of the installation and then rollsback completely 4. I am logged

  • Which 1 TB Seagate Barracuda is best for video editing?

    Hi, I'm about to buy a 1 TB drive for my Mac Pro to increase storage space for video files and not sure which one would suit me best out of the: Seagate BarracudaNL NL35 Hard drive 1 TB Internal 3.5" SATA300 7200 rpm buffer 32 MB or Seagate Barracuda

  • Playing podcasts in iTunes, jumps to next episode before finished.

    Playing a podcast in iTunes (12.1.0.50) on iMac (Yosemite, 10.10.2), after playing for about 5 min it jumped to the next episode in the list, played that one for 5 min, then jumped again, and did this until got to the end of the list, then just stopp

  • Problem executing a query with AND and OR statements

    I have no idea what is the correct way to implement this part. If the user enters more than one keyword. Then I need to check it using the clause WHERE and AND in my sql statements. Obviously, the attempt I make below does not work. Here is the code,

  • Directory Server Console is slow

    When I try to connect to Directory Server 5.1 with the console (same machine), it is ridiculously slow to respond. The machine's performance overall is fine, but console takes several minutes to respond to each mouse click.