2 Replies Latest reply on Oct 29, 2013 1:17 PM by Rohit -Oracle

    automatic garbage collection in web logic managed server


      Please share some ideas about automatic garbage collection in weblogic server.I am using WL 10.3.6.How garbage collection can be set in setdomainenv.sh file.Please share some example.

        • 1. Re: automatic garbage collection in web logic managed server

          Hi there,


          Weblogic Server runs on the standard JVM i.e either Sun Hotspot JVM or JRockit JVM.


          The task of GC Collection traditionally is made by the JVM and not the weblogic server.


          Weblogic Server cannot force GC for the applications. There is no such option that can be set in the setDomainEnv script.


          However there are several optimization mechanisms at the JVM level to get better performance of the application by lowering the pause times for GC , increasing throughput and so on.


          I suggest you to look into JDK documentation on Oracle OTN to look into GC strategies.


          Hope the above answer helps!! If you find it correct or helpful , please mark it accordingly.





          • 2. Re: automatic garbage collection in web logic managed server
            Rohit -Oracle



            The Garbage Collection (GC) happens automatically for the JavaHeap, there is no need to specify any JVM option. Actually you cannot disable GC, it is always there by default.

            It will be cleared automatically when it becomes full, cleared from the garbage. The live objects remain of course.

            At the same time, you can specify explicitly which kind of GC you want to have for your application. You can request the GC to run by System.gc() for example, but there is no guarantee that it is running if you want it.

            The GC has its own head. Well, a GC stops program execution. Hence you might trigger an explicit GC when it's convenient for example at midnight when load is lowest

            Refer: http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#gc%28%29   -->For  System.gc()

            Hope this helps.