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

Similar Messages

  • Can I force full garbage collection?

    Hi, my program is memory bound , as users load more files more memory is required , if the user decides to load a very large number of files they will eventually run out of memory. So I am trying to detect when there is less 15% of heap memory left, then force garbage collection and if it cant free up more than 15% of the heap I will stop the user from loading any more files. But the problem is though I call System.gc() to try and force a full garbage collect it rarely
    retrieve enough memory to get below the 15% limit. But using the Yourkit Profiler I can select the Force GarbageCollection option and this always manages to free up more memory to get the figure under the 15% limit. in support of this I found that sometimes my program stop me loading more files when there is still quite a bit available.
    So my questions are.
    1. I know System.gc() is only hint to garbage collect, but the docs imply it only replys after the garbage collection (if any) has been done, is this right or do I have to wait.
    2. Is there any way to Force complete Garbage Collectionas profiler appears to do.
    3. is there a VM option I could set instead to force the JVM to completely garbage collect at say 83% so that if I then polled that 85% of heap was being used I would know that it really was, and I wouldnt need to bother trying to garbage collect further. (Im using Suns 1.6. JVM on Windows and Linux, and Apples 1.5 or 1.6 JVM on Macs)
    public static void checkMemoryWhilstLoadingFiles() throws LowMemoryException
            MemoryUsage mu = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
            //No max defined future proofing
            if(mu.getMax()==-1)
                return;
            if (mu.getUsed() > (mu.getMax()  *  0.85f))
                MainWindow.logger.warning("Memory low:" + mu);
                System.gc();
                MainWindow.logger.warning("Memory low gc1:" + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());
                System.gc();
                MainWindow.logger.warning("Memory low gc2:" + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());
                System.gc();
                MainWindow.logger.warning("Memory low gc3:" + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());
                mu = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
                if (mu.getUsed()  > (mu.getMax()  *  0.85f))
                    MainWindow.logger.severe("Memory too low:" + mu);
                    throw new LowMemoryException("Running out of memory:"+mu.getUsed());
                else
                     MainWindow.logger.warning("Memory usage reduced to:" + mu);   
        }thanks for any help Paul
    Edited by: paultaylor on 27-Jun-2008 11:10

    On all of the current Sun HotSpot JVM's, calling System.gc() will cause a full compacting collection. Unless you have -XX:+DisableExplicitGC on your command line, in which case the call is a noop. Or if you are running the mostly-concurrent collector (-XX:+UseConcMarkSweepGC) and have the -XX:+ExplicitGCInvokesConcurrent flag on your command line, in which case calling System.gc() will start a concurrent collection (and the calling thread will block until the cycle is finished).
    But calling System.gc() isn't enough to recover all the space that might be recovered. For example, System.gc() will identify objects that are unreferenced but need to have their finalize() methods called before their space becomes available again. So one call to System.gc() won't recover their space. Those finalize() methods need some cycles to run in, so back-to-back (or back-to-back-to-back :-) calls to System.gc() won't help. If you use a lot of finalize() methods, you should leave a lot of time for the finalize() methods to run between the calls to System.gc(). (Better would be to convert your code to use WeakReferences and run your own reference processing queues, and then you could tell when you were done processing references. But that's real work.) Some people try calling System.runFinalization() and wait for that to return, but that has at least two failure modes (details left to the reader).
    In addition, there are details like: if there is still 15% of the heap free, then we won't aggressively clear SoftReferences when you call System.gc(). We might if you waited until the heap was full and we collected it on our own, since we know how much free space there will be after a collection at the point where we are choosing which SoftReferences to clear, and use that to decide how aggressively to clear SoftReferences.
    There is no method to force the collector to do a compacting collection at, say 85% full. There is an option to have the mostly-concurrent collector start a collection cycle that way. But there's no way to find out if a collection cycle is running.
    You are skating on the edge of the qualities of service offered by the different collectors in the various JVM's available. That weakens your ability to "write once, run anywhere".

  • Garbage Collection is not destruction?

    Garbage Collection is not destruction?
    This is one of the point from Thinking In Java 4th edition Chapter 5.Can someone please explain me this point.Does that mean that Garbage Collection does not destroy objects.If yes,then what is it role?
    And also please explain something about finalize().I tried to read it but couldn't understand.
    Thanks for your help.

    personal opinion really. I do call garbage collection destruction, the memory occupied by the objects in question is reclaimed. It is a discussion point however as it is from the perspective of the JVM; from the perspective of the application the object is "destroyed" as soon as you cut all references to it.
    What to explain about finalize()? It is invoked right before an object is garbage collected, possibly allowing you to do some last minute clean up jobs, like letting go of resource handles and such. The general rule about it is that in 99.99% of the cases you need not touch it. If you have a design where you need it, it is best to assume the design is wrong and you need to change it. For example in the case of closing resources, it is better to have a close() method that needs to be invoked manually.
    If you do use it, you better be really sure that you know what you are doing as you may cause performance problems or even hard to trace unexpected behavior.

  • Full Garbage Collection Problem

    Hi All,
    We are working on NetWeaver Application Server JAVA 7.0
    I am getting an error message in of the the EWA reports for JAVA system. The red alert says as below:
    The maximum ratio of full garbage collections to total garbage collections in the reported interval was higher than 90%.
    In order to solve the above problem, I increased Heap Memory for all JAVA Server nodes to 3072 (earlier it was 2048 for all the server nodes). However, still I am getting same error in EWA report.
    Can any one help me in further analysing and solving the above problem?
    Your help is appreciated.

    Here are links to some of the tools. I have worked with [IBM GC for IBM JVM|http://www.ibm.com/developerworks/java/library/j-ibmtools2/index.html]. You may have to try others that can read Sun JVM's GC log.
    http://www.tagtraum.com/gcviewer.html
    http://www.yourkit.com/overview/index.jsp
    https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPJMETER
    http://java.sun.com/performance/jvmstat/visualgc.html

  • [svn] 2692: Bug: BLZ-227 - When using JMS Destination, MessageClient and FlexClient not released from memory when the session times out .

    Revision: 2692
    Author: [email protected]
    Date: 2008-07-31 13:05:35 -0700 (Thu, 31 Jul 2008)
    Log Message:
    Bug: BLZ-227 - When using JMS Destination, MessageClient and FlexClient not released from memory when the session times out.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: Fixed a memory leak with JMS adapter. Also a minor tweak to QA build file to not to start the server if the server is already running.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-227
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/messaging/adapters/J MSAdapter.java
    blazeds/branches/3.0.x/qa/build.xml

    Revision: 2692
    Author: [email protected]
    Date: 2008-07-31 13:05:35 -0700 (Thu, 31 Jul 2008)
    Log Message:
    Bug: BLZ-227 - When using JMS Destination, MessageClient and FlexClient not released from memory when the session times out.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: Fixed a memory leak with JMS adapter. Also a minor tweak to QA build file to not to start the server if the server is already running.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-227
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/messaging/adapters/J MSAdapter.java
    blazeds/branches/3.0.x/qa/build.xml

  • JInternalFrame is closed, but does not release the memory

    Hi,
    I have problem with using of JInternalFrame.
    I create a new internal frame, and close it."setClosed(true);dispose();"
    The frame does not release the memory (after gc the allocated memory is the same)
    Before close I removed all listeners, and closed all reference to other object. (I think so :-) )
    Do You have any idees?
    regards
    G�bor

    Hi,
    I think u will have to release all the associated used objects. or you can also call the finalize() method in order to release the memory.
    Regards,
    Balaji.SN

  • How to specify when Full Garbage Collections occur in the Old Generation

    Hi. We seem to be having a problem with a number of JVMs (1.5.0_17-b04) that run a component of a Document Management application. This component stores a large amount of information in caches which reside in the Old Generation. Although these cache sizes can be somewhat controlled by the application, they are currently taking about 85% of the Old Generation space. Fortunately, very few objects get tenured into the Old Generation - they all are cleaned up in the New Generation space.
    The problem we are seeing is that with the Old Generation at 85% full, there are constant full GC's occurring. Since the caches cannot be removed, the system frantically tries to remove objects that can't be removed.
    We have three solutions in mind. The first is to increase the memory allocation to the Old Generation so that the caches take a smaller percentage of the available memory allocation. The second would be to decrease the size of the caches; but this is set more by the number of documents in the application and cannot be made much smaller.
    The third solution is to configure the JVM so that Garbage Collections in the Old Generation do not occur until the memory is more than a specific percentage of memory in the Old Generation. We would then set this percentage to be higher than the amount of memory being used by the caches.
    So, is it possible to tell the JVM to only run a Full GC when the memory in the Old Generation is greater than a specific value (say 85% full)?
    Thanks for your help.
    Andre Fischer.

    afischer wrote:
    The third solution is to configure the JVM so that Garbage Collections in the Old Generation do not occur until the memory is more than a specific percentage of memory in the Old Generation. We would then set this percentage to be higher than the amount of memory being used by the caches.
    So, is it possible to tell the JVM to only run a Full GC when the memory in the Old Generation is greater than a specific value (say 85% full)?Switch to the CMS collector.
    -XX:+UseConcMarkSweepGC
    -XX:CMSInitiatingOccupancyFraction=86

  • Garbage Collection is Not working

    I Installed J2dk1.4 in my System.it's garbage Collector is not working,It does'nt free the memory in case of Frames and Applets.I use many methods to explicitly free the memory, Like :
    ====================
    System.exit(0);
    System.gc();
    ====================
    but it does'nt work can any body give me the solution?
    Email : [email protected]

    How are you determining that it doesn't free memory?
    If you're expecting Task Manager to show the VM using less memory, that won't happen. GC frees memory internally, so it can use that memory for other objects. It doesn't return it to the OS.
    Also, calling gc() will not necessarily force the GC to run. Unless you're using a profiler, or getting OutOfMemoryError, you can't say for certain that the VM is not releasing memory.
    Also, even if it's not releasing it, it doesn't mean it's a problem. It's guaranteed to release it when it needs it, but it may or may not release it sooner.
    Finally, System.exit may not do anything in an applet, for security reasons.
    What is your actual problem?

  • Reducing full Garbage Collection frequency.

    I've been trying to improve the performance while inserting a large number of records to an embedded H2 database. Monitoring memory useage suggests that it's being used rather innefficiently. A lot of the objects created by H2 seem to find their way into "tenured" space before being freed. Full mark-and-sweap garbage collections are occuring every couple of seconds, despite the fact that only about 10% of the available heap is occupied.
    Any advise on tuning the garbage collector to improve throughput in this case?

    I think if surviving objects max out the to-space (part of the young generation) the remaining objects are copied into the tenured generation.
    You can get more info via:
    -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGC -Xloggc:<filename>

  • Full Garbage Collection

    Hi Friends,
    I'm using weblogic workflow for my project. Last night i got one error, once i gone throw the bea ...i come to know that the error will comes because of "once the application calls webservice and the webservice intern calls the EJB stateless or stateful will fail". But my application is not using any sort of webservices. So i try to find the problem finally i found tht the problem is because of Garbage collection of Heap Size. It is taking 3.8508577 sec's. I feel in this time the JVM thread gets heighest priority and it is killing the application thread which is to be executed as usal.
    Can u guide me how to catch this exception so tht my application won;t get affected. The actual error says like this which is related to Garbage Collection...[Full GC 313152K -> 105060K (1004928K), 3.8508577 secs]. I'm using JDK 1.4.
    Thaks & Regards
    [email protected]

    Replies in this thread.

  • Why I can not release the memory except I run System.exit()

    I have an application which runs over night. (more than 8 hours)
    after a certain period I stopped the applicatin(but it doesn't exit from JVM) reset all the object and run System.gc().
    I am sure ther is not references point to the object.
    it seams JVM hold the memory and memory is not released.
    Questions:
    1. whether JVM will "hold" memory?
    2. Is there a method to focerly release memory?
    Thanks a lot!
    Qi

    Questions:
    1. whether JVM will "hold" memory?I've notice with version 1.4.0 that it starts to release memory when about 90% of the total memory allocated is free of use.
    2. Is there a method to focerly release memory?
    No.. But you can provide it with a hint by using the System.gc();

  • Garbage collection issue as3

    Having real problems with garbage collection in as3
    Currently working on a project that is using a main movie
    clip to load other movie clips dynamicly, using loadURL.these sub
    movieclips are rather heavy in size, and function as standalone
    modules.
    Our problem is that when we removeChild of the sub clips it
    is still present in memory (which from what I have read is normal
    untill garbage collection cycle is fired) however it doesn't seem
    to ever get removed.
    how can we safely load movieclips and remove all references
    to them to make them eligible for garbage collection? current
    approach we are using is to publicly state the loader the say new
    loader() in an attempt to recycle rather that to try to send for
    garbage collection

    Hi ajmcfarlane,
    This is my first post here. I'm fairly new to AS3 still and
    have been getting my education from a number of places. The best
    education i have found is from the book located at
    http://www.learningactionscript3.com/
    Rich Shupe address this problem of removing the child from
    memory. I Downloaded your file and found 2 problems and resolved
    one of them. By now you might have already solved this anyway.
    To remove the child from the Display List use -->
    removeChild(myChildObject);
    To remove the object from memory use --> myChildObject =
    null;
    You did these two steps but in the incorrect order, just by
    moving the 'myChildObject = null' under the removeChild code makes
    it work.
    I found running a few trace statements after fixing the first
    problem, i found the second problem. The error of trying to remove
    a child when it is no longer there.
    You just need to rework the design so that the order of
    events fires as you want. Below is the traces i used and the output
    that is received.
    function Click1(e:MouseEvent){
    trace("four ", loadedcontent);
    modLoader.unload();
    modLoader = null;
    function unloadCompleteHandler(event:Event):void{
    trace("one ", loadedcontent);
    removeChild(loadedcontent);
    trace("two ", loadedcontent);
    loadedcontent = null;
    trace("three ", loadedcontent);
    output
    Loaded mem: 20668 KB
    four [object MainTimeline]
    one [object MainTimeline]
    two [object MainTimeline]
    three null
    unLoaded mem: 23352 KB
    So you can see the click event is firing of the unload first,
    when i think you want that last.
    I hope this has been of some help :)

  • Plugin to import Aperture librairies does not release the memory used by the librairy after the import is completed

    Let suppose I import a 30GB Aperture Library into LR which is on my HD. After the importation, if I send the imported library to the Trash and clear the Trash the disk space is not released by LR. So after a few importations I get the message that I do not have enough space on my HD to copy another library on the HD from an external drive which contains many Aperture libraries.

    Casita17,  I recommend you evaluate ssprengel's questions and advice.  Please read the following below, as we don't want you to lose images!  I fear that you may be using a "referenced" library in Aperture, and this is the reason your disk space is not being released.  I would NOT RECOMMEND breaking your library into pieces for now.   You may very likely lose critical linkages, especially in albums.  If you have a number of Aperture libraries to begin with, then never mind.  Just be aware, Lightroom users generally recommend using only one lightroom catalog, which it sounds like you're doing.
    Lets forget your system drive for now.  Do you have two times the disk space on your photos drive?  If not, do you have another drive laying around with as much space?  I recommend you make a backup before you continue.
    I'm not quite sure what approach your are using, but I think the root cause of your dilemma exists because of how Aperture and Lightroom manage and store your images.  It may help to post what actions you take, step by step, and include the error messages.
    You may already know some of these concepts, but lets leave no stone unturned.
    First, Aperture uses "libraries", which contain all metadata and previews.  These images may be stored within the database (managed images), outside the database (referenced images), or a combination.  Can you apply a filter to your all photos selection, and tell us how many managed and references images you have?
    Please read this for a better explanation:
    http://www.lifeafterphotoshop.com/managed-vs-referenced-files-in-aperture/
    Second, Lightroom's catalog is like an Aperture library.  Only ALL images are stored externally, "referenced" in Aperture parlance.
    You should be able to create the Lightroom Catalog on any drive.  However, where you eventually store your images depends on what options you choose in the plugin when importing these images.
    Any "managed" photos in Aperture WILL BE copied to the location you specify in the plugin.  Any "referenced" files MAY OR MAY NOT BE copied to the location.  They may be copied, or they they may remain in place, depending what options you select in the plugin.
    Not sure I follow where you have your aperture library, images, and where you eventually want to store your Lightroom catalog, and where you want to store your lightroom images.  I'd suggest not breaking up your Aperture library.
    If you are short on disk space, I suggest making a backup.  Then, select all photos and change them from managed to referenced, which will relocate the photos from within the library, to outside the library, preferably on the same drive.  Then, create a Lightroom catalog, wherever you have room.
    Run the plugin and choose the option NOT to copy the files.  This way, it will leave them in place on your photo drive.  Some images may be copied to the lightroom masters destination any way, so you may want to choose another location on your photo drive in the plugin import options anyway.
    When the migration finishes, you can delete the Aperture library, which will not remove all that much, and will not make much more space available.  And do NOT delete the image location you designated in Aperture, because you'll now be using it for Lightroom.  But this way, you'll be able to keep your space usage under control.
    But KEEP your backup, even after the migration, JUST IN CASE!

  • TimesTen not releasing shared memory even after DB destroy

    Hi,
    After TimesTen DB is destroyed, the shared memory allocated to DB is not getting released by system.
    We are using TimesTen Release 11.2.1.7.0 (64 bit Linux/x86_64)
    We need to do a system reboot for clearing the shared memory (stale) usage by TimesTen.
    Please let me know what is the issue here.
    Regards
    Pratheej

    Hi Pratheej,
    How are you actually destroying TimesTen? are you using ttDestroy? It looks like you maybe forcing a shutdown of the TT master daemon? In which case current connections won't be aware the master daemon has gone until they next try to access TT in the meantime they can keep the shared memory segment in-memory.
    Take a look at ttStatus to see what connections are open. Disconnect them all by default TT will then come out of memory then you can use ttDestroy.
    Tim

  • Frequent Garbage Collection Issues

    Hi,
    I am using Weblogic 8.1 SP6. Recently we have increase in the traffic and as a result I have seen this pattern w.r.t GC.
    While using the monitoring tab of the weblogic console I have seen that at a regular interval of about 20 secs there is a forced GC from JVM and causing the app to not respond for about 5-6 secs. We thought that some of the JVM parameters were not set properly and we raised the parameters.
    It worked fine, it is started doing every 1 minute instead of 20 secs. Is there any way we can check if any java objects are not removed from JVM heap or if there are some other configurations we need to check about the system?
    John

    Regarding objects in the Java heap that are not properly being collected, look
    at the trouble shooting guide under memory leaks.
    http://java.sun.com/javase/6/webnotes/trouble/index.html

Maybe you are looking for

  • Request number of a function module.

    Hi Experts, Can anybody plz send me the table where the request number of a function module get stored. (Function groups are stored in E071,But i need the request number for function module.) If any function module for the same plz send it Regards, A

  • Assistance required to re-establish my wireless network!

    Hi Everybody Newbie here! I hope one of you clever folks can assist me with this one. I live in Bulgaria and we have a home office with 1 x G5 iMac and 1 x G4 iBook both connected to the internet via a wireless router (both Mac's with built-in airpor

  • Code Mismatch 0X30, 0X08 iDVD 5

    Hi I have recently upgraded to ilife 05 this weekend after 2 years of using idvd 3 and imovie 3 with no problems in editing or burning. My project this weekend after upgrading was to burn a film 4 minute long with idvd 5, however when it reached the

  • IPhone Stopped Working When Updating to 4.0.2

    Hi I was wondering if anyone can help please. I tried update my iPhone 3G to 4.0.2 and its started the update and now it's just a picture of an iTunes logo and a USB cable with an arrow. Nothing at all is hapenning. When I plug it into my PC nothing

  • IPhoto 09 - Faces & Places

    I'm wondering if the new faces & places will modify the tags for photos. Currently I use tags for my "faces" and "places". For example, I have a tag for "Joe" and tag him in all of the pictures he is in. It sounds much easier with the facial recognit