Garbage Collector and verbose GC

Hi, we are getting strange behavior with the garbage collector if the verbosegc is enabled. The gc still report it is collecting memory but none is ever freed. If the option is not enabled the problem disapear. Has anyone experience something similar?
We are running on Sun 5.8 with weblogic 5.1 sp 8 and jdk 1.2.2_09

Can you post some of the verbosegc output? Output with -XX:+PrintGCDetails might
help a little more.

Similar Messages

  • Garbage collector and JPEG decoder

    Hi,
    I have a problem with the garbage collector decoding JPEG images received on a TCP socket. The process works but each time that I have to decode an image I have to create a new decoder, this causes that the garbage collector starts to work constantly looking for memory. When the gc starts to work the streamed images almost stop since the gc takes all the process.
    Here is the code that has the problem. On this code you can see that I create a new ByteArrayInputStream and a MediaTracker, but I know how reuse this objets, the problem is on the decoder.
    Does any one have an idea of how to solve it?
    Thanks
    public void cargarImagen(Visualizador vision,
                                  Cabecera cabImg,
                                  boolean completa,
                                  boolean grabar,
                                  boolean pantCIF,
                                  JFrame1 jf1)throws Exception{
            Visualizador aux;
            ByteArrayInputStream byis = new ByteArrayInputStream(s1.buffer);
            try{
                    decoder=JPEGCodec.createJPEGDecoder(byis);
                    try{
                           // decode
                                                   vision.image_Webcam=decoder.decodeAsBufferedImage();
                    }catch(ImageFormatException b){
                      System.out.println("Incorrect image format");
                    }catch(Exception a){
                      System.out.println("Incorrect image");
                    mediaTracker_track = new MediaTracker(vision);
                    mediaTracker_track.addImage(vision.image_Webcam, 0);
                 mediaTracker_track.waitForID(0,500);
            }finally{
                      byis.close();
            if(mediaTracker_track.statusID(0, false) == MediaTracker.COMPLETE){
                  vision.repaint();
             else{    /* incorrect image */
                  vision.image_Webcam = null;
                  System.out.println("Discarded image");
    }

    I think that this is not the case. Images come from a TCP connection and the application start to read the next image from the socket when the previous one has been decoded and painted.
    So, images are not stored on memory and the received images rate depens on how fast is the application reading images from the socket.
    However, it is a good idea to start gc before getting next image, the average rate will decrease but it will avoid the "jumps" on visualization.

  • Garbage collector and JVM

    is garbage collector is part of JVM or it is part of our program process.
    ie ... if we are having 3 programs running at the same time will we have one garbage collector for them or we will have 1 each ofor each process.
    what is the priority of the garbage collector as a process.

    GC is a part of JVM. GCs from different JVMs never
    intersect.hmm.
    So if i am having 3 programs of java running on one machine. how much JVM will i be running ... i guess one. so will they share one GC ???
    what is the priority of GC at process level???

  • Garbage collector don't works.

    Hello people !
    When I restart the weblogic server this do not shows the lastest change that I made. I think the problem is related to the garbage collector and its bean tree.
    Do you known how to solve this?
    Thank you.
    Regards.

    I'm working with WebLogic Server 10.0 and the problem is if I restart the server this don't holds the lastest change that I made, it happens with any type of change (deploy, undeploy, create or delete servers/services, etc).
    I've reviewed the log file and I've found the following error:
    <Jun 2, 2008 6:45:14 PM CDT> <Warning> <Management> <BEA-141269> <The temporary bean tree updateDeploymentContext(Mon Jun 02 10:46:11 CDT 2008) was allocated for an undo, get, or activate operation, but has not been garbage collected.>
    Stopping PointBase server...
    PointBase server stopped.
    Thank you for your attention

  • Force Garbage Collector calling

    Hello
    I have simple, static, single thread program. But it's a lot of memory demanding (large SortedSet, about one million items). After I finish working with this big SortedSet, I call "clear()" on it, for safe. Function uses this Set exits, and reference to this Set dies. Problem is, when this function exits, it's called multiple times again (same function), but unreferenced memory is still occupied, and heap usage grows and grows.
    I need to force calling Garbage Collector and HALT MAIN PROCESS until GC refreshes all of unref. memory.
    I tried calling "System.gc()" - without effect, parameter "-Xincgc" - without effect.
    Thank you very much for help.
    Pleas excuse my poor English, but I hope you understand me.
    Tony (Czech Republic)

    Why is this growing heap a problem, and why do you feel compelled to force gc?
    Virtually all non-trivial applications experience growing and growing heap usage.
    But the JVM should run gc when it is running out of memory anyway.
    Did you get an OutOfMemoryError?
    If you did, then you should review either your JVM heap settings, or in the worst case, your code. Your program may unintentionnally hold on to objects after being done with them (a java 'memory leak').
    If you didn't get an OutOfMemoryError, then I suggest you don't worry about it.

  • Clear method and Garbage Collector

    Hi Gurus,
    Does the Clear method (hashtable, vector etc..) is a good option for garbage collection ?
    In other words, if I have a vector V with 100 elements and I perform a V.clear(), am I sure that the 100 elements are now candidates for the Garbage Collection ?
    Or is it better to write a loop performing a NULL assignment for each element of the vector ?

    Hi schapel,
    I know it's not a good idea to force the garbage collector, but let me explain what I am confronted with.
    (FYI, I didn't write the source code. Comes from a 3rd party)
    The aim is to build a jsp page which is the list of the files contained in a web server directory.
    I have a "Directory" class, and a "File" class. To build the jsp, each directory of the webserver is represented by a directory class, and each file, ...by a file class.
    To simplify, when the tree structure of the web server is build in memory, I create a jsp page to list the files, and then, I do not need the vector anymore. But the vector can be quite huge and each client will build his own vector at the begening of his session (and will never use it again during the session).
    Don't you think it's usefull in that situation to free some memory ?

  • EMCC and Garbage Collector

    We have 2 CUCM clusters connected via an ICT. We are migrating users from CM8.6 to CM10.5. During the migration we are changing Users AD attributes so that they disappear from CM8. As this marks the user as Inactive in CM8 (and deletes after 24hrs) this prevents the User from logging into CM10 with EMCC.
    Is there a way around this?
    ie force the garbage collector to run immediately and delete the user
    or remove certain fields in CUCM 8 against the user so that they can login using CUCM10 credentials?
    Thanks
    Rich

    I think you can do something clever here. You can convert the inactive user on cucm 8 back to a standard cucm user and then delete them. This way you can control when to remove the user instea dof waiting for garbage collection. You become your own garbage man :)
    You can conver the users back to standard CUCM users using sql query update...Ths is easy to do
     run sql update enduser set status=1 ( this is the general command to make all users standard cucm users..you don't want to run this..)
    Use this command to make specific users active. You need to use the users extension to filter which user gets converted to standard cucm user
    run sql update enduser set status=1 where telephonenumber like ‘2%’
     This command will update users with extension beginning with 2
    or
    run sql update enduser set status=1 where telephonenumber = '2001'
    This will convert user with extension 2001 to a standard cucm user
     To make sure you got all the users you can use the command
    run sql select * from enduser where status=0
     This should return zero entry. If you find any user there then use the update command on those users

  • I have a memory leak, objective-c 2.0, and garbage collector...

    the code i am using is a modification of the code/problem found in "Cocoa with Objective-C", chapter 3.
    i have tried to use the objective-c 2.0 garbage collector methodology, using @property, @synthesize, etc. when i run the code as listed below i get a leaking message.
    [Session started at 2008-02-01 23:33:37 -0500.]
    2008-02-01 23:33:38.070 SongsFoundationTool[28876:10b] * _NSAutoreleaseNoPool(): Object 0x2040 of class NSCFString autoreleased with no pool in place - just leaking
    Stack: (0x96b10178 0x96a3e0f8)
    2008-02-01 23:33:38.075 SongsFoundationTool[28876:10b] Song 1: We Have Exposive
    2008-02-01 23:33:38.076 SongsFoundationTool[28876:10b] * _NSAutoreleaseNoPool(): Object 0x2060 of class NSCFString autoreleased with no pool in place - just leaking
    Stack: (0x96b10178 0x96a3e0f8)
    2008-02-01 23:33:38.078 SongsFoundationTool[28876:10b] Song 2: Loops of Fury
    The Debugger has exited with status 0.
    when i include the commented out section, in the implementation file section, the description method, and use song1 and song2, in main, instead of song1.name and song2.name the program seems to run fine.
    The Debugger has exited with status 0.
    [Session started at 2008-02-01 23:38:24 -0500.]
    2008-02-01 23:38:24.375 SongsFoundationTool[28936:10b] Song 1: We Have Exposive
    2008-02-01 23:38:24.379 SongsFoundationTool[28936:10b] Song 2: Loops of Fury
    The Debugger has exited with status 0.
    please help me understand what's happening here.
    also, why was it necessary to use
    @property(copy, readwrite) NSString *name;
    @property(copy, readwrite) NSString *artist;
    instead of
    @property(readwrite) NSString *name;
    @property(readwrite) NSString *artist;
    thanks everyone, the code is below.
    // ....................... header file ...............
    #import <Cocoa/Cocoa.h>
    @interface Song : NSObject {
    NSString *name;
    NSString *artist;
    @property(copy, readwrite) NSString *name;
    @property(copy, readwrite) NSString *artist;
    @end
    //.................... the implementation file ..................
    #import "Song.h"
    @implementation Song
    @synthesize name;
    @synthesize artist;
    -(NSString *) description
    return [ self name ];
    @end
    //................................ main............................
    #import <Foundation/Foundation.h>
    #import "Song.h"
    int main (int argc, const char * argv[]) {
    Song *song1 = [ [ Song alloc ] init ];
    song1.name= @"We Have Exposive" ;
    [ song1 setArtist: @"The Future Sound Of Londown" ];
    Song *song2 = [ [ Song alloc ] init ];
    [ song2 setName: @"Loops of Fury" ];
    [ song2 setArtist: @"The Chemical Brothers" ];
    // Display Object
    NSLog( @"Song 1: %@", song1.name );
    NSLog( @"Song 2: %@", song2.name );
    // include statements below if -description method is uncommented
    // then comment out the two statements above. no memory leak if the code
    // is used from the statements below and - description is not commented out and
    // the two NSLog statements above are commented out.
    NSLog( @"Song 1: %@", song1 );
    NSLog( @"Song 2: %@", song2 );
    return 0;
    }

    Normally, your main only has a call to NSApplicationMain(). If you aren't doing a traditional MacOS X application, you will still want at least NSApplicationLoad() to get enough of the runtime to avoid those messages.
    I don't know for sure about the syntax of Objective-C 2.0. That stuff is all new. What error message are you getting that indicated that (copy, readwrite) is required? Could you provide a link to the actual example source? I did a quick check and assign and readwrite are the defaults. It is possible that readwrite by itself makes no sense. But I'm just guessing.

  • Swing components and the garbage collector

    How much care does one need to take with swing components, with reference to running out of stack space? I ask because I'm writing a system for an automotive parts company, and the company tends to not reboot the machines very often...
    Anyway... if a JFrame is closed, is it and all its components marked for GCing? Do I need to call the dispose method, or is this part of the default close behaviour? Or is there something else entirely?
    Cheers

    In class that calls for .setVisible(false) of one JFrame u MUST call
    for dispose() method.
    so
    myFrame.setVisible(false)
    myFrame.dispose()
    myFrame = null // to help the garbage collector
    If u have classes that becames from JFrame (or JDialog) u can
    invoke in its constructors:
    this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
    This makes uncecessary to call for dispose() method explicetly.
    If u do not have this kind of classes u can invoke this method
    after u have create your JFrame
    JFrame myFrame = new JFrame();
    myFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
    The most important thing is REMOVE ALL LISETNERS that u have added, so, if u have classes that becames from JFrame u can ovverride
    the dispose method to do that
    eg
    public void dispose()
    super.dispose()
    removeActionListener(.....)
    and so on
    If u do not have this kind of classes u must remove all listeners u have
    added before u invoke the setVisible(false) method.
    Regards

  • CORBA and garbage collector

    Hi,
    I�m writing a server with a method create(), which returns a new object supplying a home banking service for the clients.
    My question is : when a given client has finished with the home banking object, do I need to call the gc, or is there an efficient one with CORBA (a kind of distributed garbage collector) ?
    Thank you in advance

    Maybe you heard about Distributed Garbage Collector (DGC)? Don't rely on this, since IIOP does not support this. Use PortableRemoteObject.unexportObject() to make remote objects that are no longer in use available for garbage collection.
    Bert

  • Incremental Garbage Collector is halting my server for MINUTES at a time.

    I have a Java server which services hundreds (currently 300-700 on average, target of 2000+) of simultaneous client connections, with a staggering number of long lived (but not permanent) objects.
    The docs for incremental garbage collection state: "The incremental garbage collector, which is off by default, will eliminate occasional garbage-collection pauses during program execution." This is NOT true in my case. During peak load, the Server halts occasionally (once an hour or more) and entire MINUTES tick by. Average wait time is 2.5 - 3.5 minutes, the highest I have seen is 4 minutes, 10 seconds. This is entirely unnacceptable.
    The server is on Red Hat Linux 6.2, kernel 2.2.14-5.0, with a gig of RAM. My current command line options are
    java -server -Xincgc -Xms256M -Xmx900M
    And I have just added -verbose:gc to help analyze the gc performance. I have read the gc tuning guide at http://java.sun.com/docs/hotspot/gc/index.html but still feel rather clueless about what is the optimum setup for my particular application.
    I will of course start experimenting, but I was hoping to find a "wise old elf" who might give some useful pointers to accelerate the process, seeing as how the Server is already running in a production capacity, time is critical.

    Are you using a Java application server like Tomcat, Dynamo, WebLogic etc. ?
    In that case consider running several server instances on the machine, with the applicationserver's software load balancer. Find the amount of RAM allocated to the heap per serverinstance where garbage collection runs takes a couple of seconds, and don't allocate more than this to each server. Start as many servers as you have available RAM for.
    This is the approach recommended by application server vendors such as BEA http://edocs.bea.com/wls/docs61/perform/JVMTuning.html and ATG.
    A side benefit of this approach is that in case you get more concurrent users than your computer can handle, you already have the setup for spreading the load over several computers.

  • Logging Garbage collector for an OC4J with 2JVM

    Hi, I have one OC4J with two JVM setted.
    If I put -verbose:gc it logs in the std Output file.
    I trying to log the garbage collector in two different file each one for one JVM.
    Anyone as an idea?

    Don't create massive amounts garbage memory. It's that simple. You should try to limit the creation of memory inside your animation loop. If there is a process inside the loop that creates memory, there is definitely some way to create that item staticly, rather than allocating new memory with each iteration. There shouldn't be any kind of problem that would involve the creation of THIS much memory, and it's deallocation. If you read about how the garbage collector is implemented, you'll notice that it stores all of it's memory on a single conveyor belt. This is for ALL memory in the program. Therefor once the garbage collector has gone through and marked all of the memory that needs to be reclaimed, it performs it's sweep and must feeze the entire program because that conveyor belt can not be manipulated while it's re-arranging the memory. The garbage collector will eliminate MOST memory leaks, but it does not eliminate any thought on the part of the programmer about memory.
    -Jason Thomas.

  • Garbage Collector seems not to run

    Hi!
    I have a problem with the garbage collector:
    To free memory, I regularly run the garbage collector in my app ( System.gc() ) after releasing resources by setting the reference variable to "null". But after some time I get an "out of heap memory" error. It seems that the gc doesn't run - I get the following result on the stdout:
    0 garbage collections (0 bytes collected)
    Is this possible? Or can I fix this problem?
    Thanks for your help

    Is it that the GC was not kicking-in even when you delete the references to the objects? That is true for any GC. GC will kick in only when you need more memory to create new objects
    Also, you need to tune your young generation space and increase it from default 2MB to 32MB which will avoid frequent young generation GCs. By setting Xmx to 1024 MB, VM will try to grow till 1024 MB and if it can't allocate because
    of less physical memory on your system, it will throw OutOfMemory errors.
    I suggest you try the following:
    1. Configure young generation to 32MB and old generation to 512 MB. This is how
    you start your app
    java -XX:MaxNewSize=32m -XX:NewSize=16m -Xms64m -Xmx512m -verbose:gc <app>
    This sets the initial heap size to 64MB. You can increase this if your initial startup memory requirement (static memory) is higher that 64MB.
    With Xmx set to 512MB, if some sessions die or are closed and heap size grows to 512MB, Full GC should kick in and you should be able to release memory for new sessions. Running with -verbose:gc will show if Full GC gets kicked in or not.
    2. Try can calculate the static memory required at any point of time and also how much garbage is collected in certain time period. Then using these values we can make changes in young and old generation sizes.

  • Garbage Collector Problems

    Problem: The garbage collector on my server runs aprox every 1 min for
    about 8 secs swamping the CPUs.
    I started a not so big version of my "big server" using the following:
    JDK 1.4
    Windows NT 4.0
    Compaq Proliant with 4 CPUs @ 800Mhz
    4GB SDRAM
    I am starting with the following parametrs:
    -mx1536m -verbose:gc -XX:-DisableExplicitGC -Xrs
    On start up, my server creates a lot of objects that will live forever. Over
    time any time period only a few objects (in comparison) are created that
    will die young. I assume that I want a large older generation and a smaller
    young generation. I need enoug room in my older generation for my older
    objects plus room for the minor collections since they use copy collection.
    The verbose gc trace shows the collector running ~every min. Here is a snip
    of the log:
    17:35:57 | [Full GC 245559K->245496K(441840K), 8.2943686 secs]
    17:36:35 | [Full GC 245577K->245507K(441840K), 8.2816641 secs]
    17:37:13 | [Full GC 245588K->245526K(441840K), 8.3754267 secs]
    17:37:52 | [Full GC 245617K->245554K(441840K), 8.2831863 secs]
    17:38:30 | [Full GC 245635K->245573K(441840K), 8.2977681 secs]
    I let the server run and there were hundres of these with never a minor gc.
    My analysis (Are my assumtions correct?)
    1. I do not see minor collections happening so I assume these full
    collections are not caused by collection of the young generations.
    2. Since during my test run I know that no one is hitting my server, there
    should not be and are not and significant memory changes that would require
    a minor collection (which is why I don't see them).
    3. I am using Visobroker which, like RMI, may be making explicit gc calls.
    To prevent this I tried calling -XX:+DisableExplicitGC yet the GC seems to
    wants to run every minuite.
    Is -XX:+DisableExplicitGC supported on JDK1.4 Win32?
    Could something else be causing these Full GCs?
    -Chris

    I have one other suggestion, but it is a long shot. The total size of your heap is around 440M and the total in use is very close to 60% of that value.
    Since the JVM by default tries will consider increasing the heap size (up to -Xmx) when the free space falls below 40% AFTER GC, perhaps it is GC-ing periodically because of that. This sounds stupid since it should adjust heap size because of GC, but it is worth a try.
    You might consider this...
    java -Xms440m -Xmx1536m -Xminf0.1 -Xmaxf0.9 ...
    This will mean that the heap will only expand when you have less than 10% free and will contract only when you have more than 90% free, but only to value of -Xms.
    You also might consider -Xincgc as well, which should eliminate the 8-second pauses in favor of a more distributed gc load. Since you are alrready getting hit by >10% GC overhead, this may give you overall greater throughput as well, but I wouldn't bet on it.
    Are you using the -server JVM? If not, I'd switch to that as well.
    Chuck

  • Optimization of the JVM memory - Garbage Collector

    Hi ,
    Just a question about JVM memory management.
    There is memory limitation of memory usage limitation (1.6M) in JVM.
    Is there any possibility to use "Garbage collector" mechanism to optimize the memory usage?
    Or any suggestions for the JVM memory optimization?
    Thanks a lot!!!

    nicolasmichael wrote:
    Hi,
    the "memory limitation" does not have anything to do with garbage collection, but with the address space your operating system provides. On a 32bit operating system, your virtual address space is limited to <= 4 GB, depending on your operating system (for example 1.something GB on Windows and 3.something GB on Solaris). No.
    Windows 32 bit has a 2 GB application space and can be configured to allow a 3GB space.
    The Sun VM does not allow more because of the way that the executable is linked.
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4358809]

Maybe you are looking for