Swing Transferhandler prevents garbage collection of one Component

While searching for memory leaks in my app I found out that an object wasn't garbage collected because of a static reference from javax.swing.TransferHandler.
Once an app has called TransferHandler.exportAsDrag, TransferHandler keeps alive one static reference to a SwingDragGestureRecognizer.
    public void exportAsDrag(JComponent comp, InputEvent e, int action) {
        int srcActions = getSourceActions(comp);
        // only mouse events supported for drag operations
     if (!(e instanceof MouseEvent)
                // only support known actions
                || !(action == COPY || action == MOVE || action == LINK)
                // only support valid source actions
                || (srcActions & action) == 0) {
            action = NONE;
        if (action != NONE && !GraphicsEnvironment.isHeadless()) {
         if (recognizer == null) {
          recognizer = new SwingDragGestureRecognizer(new DragHandler());
            recognizer.gestured(comp, (MouseEvent)e, srcActions, action);
     } else {
            exportDone(comp, null, NONE);
....As you can see there is a call to recognizer.gestured(comp, (MouseEvent)e, srcActions, action). This object saves a reference to the component comp.
This means that the last Component for which the exportAsDrag method was called (and the gestured call was reached); and all objects refererred to by the Component can not be garbage collected.
I think in a normal application this will be not much of a problem because it's only a reference to a single Component; but still I think this is not very nice.
Should I report this as a bug somewhere?

Something similar seems to happens to JInternalFrame.lastFocusOwner
Oh well, I guess I shouldn't worry too much about single references; I don't think they immediately cause memory leaks..

Similar Messages

  • Preventing garbage-collection of a RMIRegistered server object

    I am developping a client/server RMI application, and keep facing occasional ObjectNotFioundException: no such object in table, when the client tries to invoke method on the server stub retrived from the RMIRegistry.
    The Javadoc and online documentation say this means the server object has been GC'ed since it has been registered in the RMIRegistry.
    Following the advice found at: http://www.nabble.com/java.rmi.NoSuchObjectException:-no-such-object-in-table-t260095.html,
    I register the server in a RMIRegistry I obtain through LocateRegistry.getRegistry(), and not createRegistry().
    But I still face these exceptions.
    Assuming the issue is really due to the server object being garbage-collected, I tried to keep a static reference to the server but it didn't help (the Main class was probably garbage-collected itself).
    As a last hope, I've set up a "keep-alive" thread in the server VM, that keeps a direct reference to the server object (not the stub), and regularly invokes something on it. With this mechanism I never face the exception.
    This solution looks obviously clumsy.
    Is there a neater way to prevent garbage collection of the server object?
    Note that I use dynamic stubs (Java5-style).

    Without seeing some code, I'm not sure what you are doing. Also the link you supplied is broken.
    You always need to keep a live reference to your implementation class. How you do this is your business. Using a separate thread is over-kill.
    I set a reference to the implementation class in the start up class and use a never ending wait() to make sure the start up class thread (with the main()) lives forever.

  • A possibility to prevent garbage collection?

    inspired by the topic "Why can we force Garbage Collection" i asked myself if it is possible to explicitly prevent the automatic garbage collection of the VM.
    regards
    ~elchaschab

    hmm.. you didn't understand my question.
    it's not about prevent the VM from freeing unused
    objects, it's about preventing it doing it at the
    wrong moment (e.g. a highly interactive part of code).No. But Sun's current GC works in smallish increments to reduce the impact. In extremis, you'd have to look at the realtime java project.
    As for preventing objects from being reclaimed, even storing a reference to the object isn't sufficient. You have to provide code that convinces the optimiser that the object will actually be used again in a way that the optimise can't conclude is functionally null. Putting it in a list that will be traversed by an on-exit handler, which in turn will pass it to a native method would do it. Not sure whether anything else is sufficient.
    Now throw in Reference objects and finalizers, and things really get exciting :(
    Sylvia.

  • 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

  • Aggressive Heap and garbage collection in 1.4.2

    We are trying to monitor the memory usage and the garbage collection for one of our application servers. We are using JDK 1.4.2 b-19 on solaris 8. The machine has 4 900 Mhz CPUs and 8GB ram. The VM options are:
    -server -XX:+AggressiveHeap -Xms3512m -Xmx3512m -verbose:gc
    -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCTimestamps.The first full GC kicks in when the old generation gets full which is understandable. After that however, the full gc kicks in much more frequently and even the gc pauses are fairly long. Below are some of the output from gc.
    For the first GC the old generation was almost full.
    PSYoungGen total 1379840K, used 1324288K
    PSOldGen total 2123648K, used 2103378K
    For the second GC, young generation is 25MB out of 1300MB and old generation is 1100MB out of 2100MB. Still the full gc kicked in and took 23 secs.
    PSYoungGen total 1356608K, used 25856K
    PSOldGen total 2123648K, used 1169626K
    I understand that the adaptive sizing is kicking in (by default) but it should make life better not worse. If the full GC could wait till the old generation gets full again, I will get lesser number of full gc pauses and few and far in between.
    Any idea as to what I can do?
    thanks
    vinay
    {Heap before GC invocations=108:
    Heap
    PSYoungGen      total 1379840K, used 1324288K [0x1a000000, 0x73e20000, 0x73e20000)
      eden space 228096K, 100% used [0x1a000000,0x27ec0000,0x27ec0000)
      from space 1151744K, 95% used [0x27ec0000,0x6ad40000,0x6e380000)
      to   space 92800K, 0% used [0x6e380000,0x6e380000,0x73e20000)
    PSOldGen        total 2123648K, used 2103378K [0x73e20000, 0xf5800000, 0xf5800000)
      object space 2123648K, 99% used [0x73e20000,0xf4434af8,0xf5800000)
    PSPermGen       total 31872K, used 31768K [0xf5800000, 0xf7720000, 0xf9800000)
      object space 31872K, 99% used [0xf5800000,0xf7706200,0xf7720000)
    2842.142: [Full GC 3427666K->1083494K(3503488K), 26.6495189 secs]
    Heap after GC invocations=108:
    Heap
    PSYoungGen      total 1379840K, used 0K [0x1a000000, 0x73e20000, 0x73e20000)
      eden space 1287040K, 0% used [0x1a000000,0x1a000000,0x688e0000)
      from space 92800K, 0% used [0x6e380000,0x6e380000,0x73e20000)
      to   space 92800K, 0% used [0x688e0000,0x688e0000,0x6e380000)
    PSOldGen        total 2123648K, used 1083494K [0x73e20000, 0xf5800000, 0xf5800000)
      object space 2123648K, 51% used [0x73e20000,0xb6039978,0xf5800000)
    PSPermGen       total 63744K, used 31768K [0xf5800000, 0xf9640000, 0xf9800000)
      object space 63744K, 49% used [0xf5800000,0xf7706200,0xf9640000)
    {Heap before GC invocations=114:
    Heap
    PSYoungGen      total 1356608K, used 25856K [0x1a000000, 0x73e20000, 0x73e20000)
      eden space 1240576K, 0% used [0x1a000000,0x1a000000,0x65b80000)
      from space 116032K, 22% used [0x6ccd0000,0x6e610000,0x73e20000)
      to   space 116032K, 0% used [0x65b80000,0x65b80000,0x6ccd0000)
    PSOldGen        total 2123648K, used 1169626K [0x73e20000, 0xf5800000, 0xf5800000)
      object space 2123648K, 55% used [0x73e20000,0xbb456858,0xf5800000)
    PSPermGen       total 65536K, used 31773K [0xf5800000, 0xf9800000, 0xf9800000)
      object space 65536K, 48% used [0xf5800000,0xf7707578,0xf9800000)
    3153.022: [Full GC 1195482K->1149586K(3482688K), 23.3155823 secs]
    Heap after GC invocations=114:
    Heap
    PSYoungGen      total 1359040K, used 0K [0x1a000000, 0x73e20000, 0x73e20000)
      eden space 1245440K, 0% used [0x1a000000,0x1a000000,0x66040000)
      from space 113600K, 0% used [0x6cf30000,0x6cf30000,0x73e20000)
      to   space 113600K, 0% used [0x66040000,0x66040000,0x6cf30000)
    PSOldGen        total 2123648K, used 1149586K [0x73e20000, 0xf5800000, 0xf5800000)
      object space 2123648K, 54% used [0x73e20000,0xba0c4830,0xf5800000)
    PSPermGen       total 65536K, used 31773K [0xf5800000, 0xf9800000, 0xf9800000)
      object space 65536K, 48% used [0xf5800000,0xf7707578,0xf9800000)
    }

    We also had similar issues...If you are using RMI it might cause Full GC. This is the snippet from http://java.sun.com/docs/hotspot/gc/
    <snip>
    Garbage can't be collected in these distributed applications without occasional local collection, so RMI forces periodic full collection. The frequency of these collections can be controlled with properties. For example,
    java -Dsun.rmi.dgc.client.gcInterval=3600000
    -Dsun.rmi.dgc.server.gcInterval=3600000
    </snip>
    By default this is 1 min. So try changing this and try it out.

  • Garbage collection and closure

    I am running a remote script from bridge that opens a complex dialog in photoshop. I need to run the dialog in photoshop because it displays fonts, styles and actions, which are not available in bridge.
    When I close the dialog I return to my bridge script. If I repeated open the remote script with the complex dialog I continue to use up resources and the dialog opens more slowly each time.
    If I run the remote script directly from the ESTK I still lose reources and it slows down, but not as significantly as when run as a remote script via bridgetalk.
    I think this is caused by inner functions in my dialog, which are creating closures, which in turn are preventing garbage collection.
    Has anyone experienced this and do you have any tips to prevent the performance degradation?

    Rory,
    I've never seen that before. In PS, the script that displays the dialog executes, then the engine that ran it supposed to be destroyed. Should be no need for garbage collection. Running the script directly in ESTK still uses BridgeTalk, so I would expect little difference.
    I'd be curious to know what's happening because each time you run the script, it should be using a fresh scripting engine in PS. Perhaps there's something preventing PS from releasing the engine when BridgeTalk is involved. It that's the case, it would be a bug.
    I do have a suggestion - instead of switching to PS, why not ask PS to give you lists of fonts, styles, and actions? You could write a script that put all three into a an array:
    // up here create the arrays
    var a = new Array();
    a[0] = fontArray;
    a[1] = styleArray;
    a[2] = actionArray;
    a.toSource();
    eval'ing the message body in the onResult handler would give you all the info you needed to show your dialog in Bridge. Both Bridge and PS use scriptUI, so the dialog you have written should work in either (once you get the information necessary to display it in Bridge).

  • How can I prevent class garbage collection????

    Hi,
    Is there a way to prevent a class from being garbage collected without using the -noclassgc option? Is there some code I can include in a class that tells the JVM not to garbage collect that particular class?
    Thanks in advance,
    Jacob.

    The code shown below (slightly modified from yours) should work correctly on any 1.0.x throught 1.4 JVM.
    Look at this article for further info: http://www.javaworld.com/javaworld/javatips/jw-javatip52.html
    public class SQLManager extends PoolManager {
        private static SQLManager myself;
        //code.........................
        public static SQLManager getInstance() {
            // This version of a getInstance method suffers from the use of the
            // broken (unreliable) double checked locking idiom.  It should never
            // be used on a system with more than one processor and is ill-advised
            // any other time.  It can  lead to accesses to uninitialized objects.
            // See http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-double.html
            // or http://c2.com/cgi/wiki?DoubleCheckedLockingIsBroken
            // So despite its common appearance in books and pattern repositories,
            // it should not be used.
            if (myself == null) {
                synchronized(SQLManager.class) {
                    if (myself == null)
                        myself = new SQLManager();
            return myself;
        private SQLManager() {
            livethread();
            //code.........................
        void livethread()
            System.out.println("##############################################################");
            System.out.println("###################Live Thread called#########################");
            System.out.println("##############################################################");
            Thread thread = new Thread()
                public void run()
                    // added this code to ensure that run() actually is getting
                    // called
                    System.out.println("##############################################################");
                    System.out.println("#################### Thread Started ##########################");
                    System.out.println("##############################################################");
                    Class myClass = SQLManager.class;
                    while (true)
                        try
                            synchronized (myClass)
                                myClass.wait();
                        catch (InterruptedException ex)
                            System.out.println("##############################################################");
                            System.out.println("###################Thread interrupted#########################");
                            System.out.println("##############################################################");
                        finally
                            System.out.println("##############################################################");
                            System.out.println("################### Something Happened #########################");
                            System.out.println("##############################################################");
                    System.out.println("##############################################################");
                    System.out.println("#################### Thread Dead?? ##########################");
                    System.out.println("##############################################################");
            thread.setDaemon(true);
            System.out.println("##############################################################");
            System.out.println("#################### Starting Thread #########################");
            System.out.println("##############################################################");
            thread.start();
        //code.........................
    }

  • Swing & Garbage Collection

    If the EventQueue is very active does that starve the garbage collection? Here is the scenario:
    Lets say I have a JFrame that listens for a specific keyboard event. In processing that event a heavy weight JComponent is created and displayed within that frame. If the user, in rapid succession, triggers those key events, and continues to, the allocated memory increases dramatically unitl an out of memory exception occurs.
    Does anyone know if alot of processing is occuring on the Swing EventQueue if that might starve garbage collection?
    Thanks
    Scott

    Firstly, if garbage collection is happening later then you're probably ok. You can't force garbage collection - as long as it gets cleared later the only problem you should ever have is the possibility of some piece of code being slowed slightly by the garbage collector kicking in.
    Secondly, it's best to flush() images before the references are lost. Note that you lose an image reference during your getScaledInstance() line, so you should use a temporary variable to allow you to flush.
    It's been a long time since I looked at Jimi, might you need to perform some sort of cleanup on that canvas before nulling it? I'm also not sure why you're using File and JimiCanvas objects when you can just use the ImageIcon(String) constructor to load the image in one line and reduce the risk of introducing errors.

  • Animation gets slow when program needs a Garbage Collect.

    So nonetheless, I should probably develop a new animation algorithm, yes?
    I am looping through a seperate thread that calls the setSize() methods a bunch of times. Works really nice when memory isnt bad, but when I need to garbage collect, and apparantly java doesnt agree, it gets really slow. Later one is really able to see when a GC is actually done, and it goes back to normal.
    Here is my algorithm,
    public static boolean raisePanel(final VCMSComponentFrame p, final boolean anim)
            if (p.getState() == VCMSComponentFrame.State.RAISED ||
                p.getState() == VCMSComponentFrame.State.ANIMATING)
                return false;
            new Thread(new Runnable()
                public void run()
                    p.setState(VCMSComponentFrame.State.ANIMATING);
                    if (anim)
                        for (int i = p.getHeight(); i <= FULL_PANEL_HEIGHT; i++)
                            try
                                p.setSize(p.getWidth(), i);
                                JComponent parent = (JComponent)p.getParent();
                                int index = findIndex(p);
                                for (int j = index + 1; j < parent.getComponentCount() && j != 0; j++)
                                     parent.getComponent(j).setLocation(parent.getComponent(j).getX(), parent.getComponent(j).getY() + 1);
                                //Viewport Panel
                                parent.setSize(parent.getWidth(), parent.getHeight() + 1);
                                //Structure Frame
                                VCMSStructurePanel panel = (VCMSStructurePanel)parent.getParent();
                                parent.getParent().setSize(panel.getWidth(), panel.getHeight() + 1);
                                //Structure Siblings.
                                JPanel master = (JPanel)panel.getParent();
                                index = findStructureIndex(panel);
                                for (int j = index + 1; j < master.getComponentCount() && j != 0; j++)
                                    master.getComponent(j).setLocation(master.getComponent(j).getX(), master.getComponent(j).getY() + 1);
                                Thread.sleep(1);
                            catch (Exception ex)
                    else
                        p.setSize(p.getWidth(), FULL_PANEL_HEIGHT);
                        JPanel parent = (JPanel)p.getParent();
                        int index = findIndex(p);
                        //Viewport Panel
                        parent.setSize(parent.getWidth(), parent.getHeight() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                        //Structure Frame
                        VCMSStructurePanel panel = (VCMSStructurePanel)parent.getParent();
                        parent.getParent().setSize(panel.getWidth(), panel.getHeight() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                        //Component Siblings
                        for (int j = index + 1; j < parent.getComponentCount() && j != 0; j++)
                            parent.getComponent(j).setLocation((int)parent.getComponents()[j].getLocation().getX(), (int)parent.getComponents()[j].getLocation().getY() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                        //Structure Grandparent
                        JPanel master = (JPanel)panel.getParent();
                        index = findStructureIndex(panel);
                        for (int j = index + 1; j < master.getComponentCount() && j != 0; j++)
                            master.getComponent(j).setLocation((int)master.getComponent(j).getLocation().getX(), (int)master.getComponent(j).getLocation().getY() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                    p.setState(VCMSComponentFrame.State.RAISED);
            }).start();
            //System.gc();
            return true;
        }any help appreciated!

    sierratech wrote:
    Only a guess, but this may have something to do with Threads and Swing.
    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html.
    Many Swing updates should be called in the Event Dispatch thread, and it looks like you may be calling some of these in your new Thread.
    Try using SwingUtilities.invokeLater() and see if that helps. Alternatively, rewrite your code to remove the Thread and do everything in the event Dispatch thread using javax.swing.Timer. Again, just a guessThanks for the Idea, but this option doesnt even show the animation.
    One Idea I got from a "Swing Hacks" directory works like this:
    Remove the components for animation.
    Create an image of the components.
    Overide the Paint method.
    Animate the images via paint method.
    Remove the images.
    Add back the components.
    But I look at that and my stomach cringes.
    Any other Ideas?

  • JInternalFrame & Garbage Collection

    I am looking for a work-around for the long standing bug [4759312|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4759312]. In this bug, the JDesktopFrame maintains a reference to the last JInternalFrame to be closed, preventing it from being garbage collected. The recommendation that I have seen elsewhere is to remove everything from the JInternalFrame's contentPane so that those component's can be collected even if the JInternalFrame is not. However, that approach is not working for me. Here is an example that demonstrates the problem:
    Edited: Removed example as it contained some typos, see below
    If you create a new window, and then close it, the SimplePanel it stays in memory. My debugger shows that it's only references are it's button and layout manager. However, the button is referenced from JInternalFrame.lastFocusOwner, which is probably what is preventing it from being collected.
    How can I clear this reference? Is there another workaround to this bug that works better?
    Sorry, if this has been addressed before - the search on the old forums.sun.com is taking several minutes to respond to a query.
    Edited by: 797984 on Sep 30, 2010 11:49 AM

    6.th JInternalFrame raised (Netbeans debuger has correct delay) you can test it if you runs your code with builded profilier (Profile)
    run BuiltIn Profilier in NetBeans and check which Object exists, are still registred in current JVM instance,
    import java.awt.Window;
    import javax.swing.JInternalFrame;
    import javax.swing.event.InternalFrameAdapter;
    import javax.swing.event.InternalFrameEvent;
    public class TopLevelDesktop extends javax.swing.JFrame {
        private static final long serialVersionUID = 1L;
        private javax.swing.JDesktopPane desktopPane;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JButton newSimpleInternalWindow;
        private javax.swing.JButton gcButton;
        private javax.swing.JLabel maxMemory;
        private javax.swing.JLabel totalMemory;
        private javax.swing.JLabel usedMemory;
        private javax.swing.JLabel freeMemory;
        public TopLevelDesktop() {
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setMinimumSize(new java.awt.Dimension(400, 300));
            jPanel1 = new javax.swing.JPanel();
            jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS));
            desktopPane = new javax.swing.JDesktopPane();
            newSimpleInternalWindow = new javax.swing.JButton();
            newSimpleInternalWindow.setText("New Internal Window");
            newSimpleInternalWindow.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    final JInternalFrame internalFrame = new JInternalFrame("Hi", true, true, true, true);
                    internalFrame.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
                    internalFrame.addInternalFrameListener(new InternalFrameAdapter() {
                        @Override
                        public void internalFrameClosed(InternalFrameEvent e) {
                            e.getInternalFrame().getContentPane().removeAll();
                            e.getInternalFrame().getContentPane().requestFocusInWindow();
                            remWins(internalFrame);
                            Runtime runtime = Runtime.getRuntime();
                            long total = runtime.totalMemory();
                            long free = runtime.freeMemory();
                            long max = runtime.maxMemory();
                            long used = total - free;
                            System.out.println("Remove new JInternalFrame : " + Math.round(max / 1e6) + " MB available");
                            System.out.println("Remove new JInternalFrame : " + Math.round(total / 1e6) + " MB allocated");
                            System.out.println("Remove new JInternalFrame : " + Math.round(free / 1e6) + " MB free");
                            System.out.println("Remove new JInternalFrame : " + Math.round(used / 1e6) + " MB used");
                    internalFrame.getContentPane().add(new SimplePanel());
                    internalFrame.pack();
                    internalFrame.setVisible(true);
                    desktopPane.add(internalFrame);
                    Runtime runtime = Runtime.getRuntime();
                    long total = runtime.totalMemory();
                    long free = runtime.freeMemory();
                    long max = runtime.maxMemory();
                    long used = total - free;
                    System.out.println("Add new JInternalFrame : " + Math.round(max / 1e6) + " MB available");
                    System.out.println("Add new JInternalFrame : " + Math.round(total / 1e6) + " MB allocated");
                    System.out.println("Add new JInternalFrame : " + Math.round(free / 1e6) + " MB free");
                    System.out.println("Add new JInternalFrame : " + Math.round(used / 1e6) + " MB used");
            jPanel1.add(newSimpleInternalWindow);
            gcButton = new javax.swing.JButton();
            gcButton.setText("Run Garbage Collection");
            gcButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    Runtime runtime = Runtime.getRuntime();
                    runtime.gc();
                    long total = runtime.totalMemory();
                    long free = runtime.freeMemory();
                    long max = runtime.maxMemory();
                    long used = total - free;
                    maxMemory.setText(Math.round(max / 1e6) + " MB available");
                    totalMemory.setText(Math.round(total / 1e6) + " MB allocated");
                    freeMemory.setText(Math.round(free / 1e6) + " MB free");
                    usedMemory.setText(Math.round(used / 1e6) + " MB used");
                    System.out.println("Add new JInternalFrame : " + Math.round(max / 1e6) + " MB available");
                    System.out.println("Add new JInternalFrame : " + Math.round(total / 1e6) + " MB allocated");
                    System.out.println("Add new JInternalFrame : " + Math.round(free / 1e6) + " MB free");
                    System.out.println("Add new JInternalFrame : " + Math.round(used / 1e6) + " MB used");
            jPanel1.add(gcButton);
            maxMemory = new javax.swing.JLabel();
            totalMemory = new javax.swing.JLabel();
            usedMemory = new javax.swing.JLabel();
            freeMemory = new javax.swing.JLabel();
            jPanel1.add(maxMemory);
            jPanel1.add(totalMemory);
            jPanel1.add(usedMemory);
            jPanel1.add(freeMemory);
            getContentPane().add(jPanel1, java.awt.BorderLayout.WEST);
            getContentPane().add(desktopPane, java.awt.BorderLayout.CENTER);
            pack();
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new TopLevelDesktop().setVisible(true);
        public void remWins(JInternalFrame internalFrame) {
            Window[] w;
            w = Window.getOwnerlessWindows();
            int n = 0;
            n = w.length;
            if (n > 1) {
                for (int i = 2; i <= w.length;) {
                    w[i - 1].setVisible(false);
                    i++;
            n = 0;
            n = internalFrame.getComponentCount();
            if (n > 0) {
                //Component[] a = panel.getComponents();
                 /*Component[] components = panel.getComponents();
                String compName = "";
                for (int i = 0, l = components.length; i < l; i++) {
                /*if (components[i] instanceof JButton) {
                JButton button = (JButton) components;
    if (button.hasFocus()) { // from which component
    String btnMane = button.getName();
    } else if (components[i] instanceof JComboBox) {
    } else if (components[i] instanceof JTextField) {
    } else if (components[i] instanceof JTable) {
    } else if (components[i] instanceof JScrollPane) {
    } else */
    /*if (components[i] instanceof JPanel) {
    JPanel pnl = (JPanel) components[i];
    compName = pnl.getName();
    compName = pnl.getUIClassID();
    compName = pnl.toString();
    int n1 = 0;
    n1 = pnl.getComponentCount();
    if (n > 0) {
    Component[] components1 = pnl.getComponents();
    String compName1 = "";
    for (int i1 = 0, l1 = components1.length; i1 < l1; i1++) {
    /*if (components[i] instanceof JButton) {
    JButton button = (JButton) components[i];
    if (button.hasFocus()) { // from which component
    String btnMane = button.getName();
    } else if (components[i] instanceof JComboBox) {
    } else if (components[i] instanceof JTextField) {
    } else if (components[i] instanceof JTable) {
    } else if (components[i] instanceof JScrollPane) {
    } else */
    /*if (components1[i1] instanceof JPanel) {
    JPanel pnl1 = (JPanel) components1[i1];
    compName1 = pnl1.getName();
    compName1 = pnl1.getUIClassID();
    compName1 = pnl1.toString();
    pnl1 = null;
    pnl = null;
    internalFrame.removeAll();
    Runtime runtime = Runtime.getRuntime();
    long total = runtime.totalMemory();
    long free = runtime.freeMemory();
    long max = runtime.maxMemory();
    long used = total - free;
    System.out.println("Remove new JInternalFrame : " + Math.round(max / 1e6) + " MB available");
    System.out.println("Remove new JInternalFrame : " + Math.round(total / 1e6) + " MB allocated");
    System.out.println("Remove new JInternalFrame : " + Math.round(free / 1e6) + " MB free");
    System.out.println("Remove new JInternalFrame : " + Math.round(used / 1e6) + " MB used");
    hint inside remWins, plus minus citiBus                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • URL class is not being garbage collected

    I have created two instances of the URL class to specify a file location for each image. I use com.symantec.itools.javax.swing.icons.ImageIcon class to display images specified by each URL instance as icons inside a button. The setImageLocation method(URL location) of the ImageIcon class sets the location to be displayed by this icon. The following is the code snippets used to create the ImageIcon instances:
    private URL greenIconURL;
    private URL redIconURL;
    com.symantec.itools.javax.swing.icons.ImageIcon green_icon = new com.symantec.itools.javax.swing.icons.ImageIcon();
    com.symantec.itools.javax.swing.icons.ImageIcon red_icon = new com.symantec.itools.javax.swing.icons.ImageIcon();
    try
    greenIconURL = new java.net.URL
    ("file:./images/greenline.gif");
    green_icon.setImageLocation(greenIconURL);
    catch (java.net.MalformedURLException error) { }
    try
    redIconURL = new java.net.URL
    ("file:./images/redline.gif");
    red_icon.setImageLocation(redIconURL);
    catch (java.net.MalformedURLException error) { }
    I am using JProbe 5.0.1 Memory to determine the loitering objects when I remove the button from the JInternalFrame. I am using Java 1.2.2_08 version. The JProbe Memory Leak Doctor indicates that each URL instance has a reference to an entry in a HashMap table. The reference graph from the root set has a reference to SoftCache to HashMap to HashMap$Entry. To make this URL instance eligible for garbage collection, JProbe Memory Leak Doctor indicates I must remove the entry from the HashMap. How do I get access to this HashMap to remove the entry? If this is a problem with the version of the JDK, please let me know. Thank you in advance for your assistance.

    <root>Statics
    -->sun.misc.SoftCache->java.util.HashMap->java.util.Has
    Map$Entry[]->java.util.HashMap$Entry->java.net.URL
    I do not an instance of HashMap in my class.
    Therefore, the HashMap is either created by URLclass
    or the
    com.symantec.itools.javax.swing.icons.ImageIcon
    class.SoftCache seems to have a normal HashMap inside
    it/* Hash table mapping keys to ValueCells */
    private Map hash;but if that is the HashMap in JProbe
    information then the URL would have to be a key in
    the map - otherwise there'd be another object in the
    chain of class SoftCache.ValueCell
    are you certain that the java.net.URL's in that
    hashmap are your ones?
    out of curiosity - are you certain that the URL's are
    the/a problem (are you getting an OutOfMemoryError?)
    asjfThe button that contains the URL's is the only one on the JInternalFrame. The JProbe Memory Debugger displays the java.net package name, the URL class name, the count (2), and the Count Change (+2). When I remove the button from the JInternalFrame, the aforementioned numbers on the Instance Summary remain the same. The snapshot of the Java Heap reveals that the two instances of the URL class are still there. The Memory Leak Doctor shows the reference graph from the root set:
    <root>Statics->SoftCache->HashMap->HashMap$Entry[]->HashMap$Entry->URL
    When I right click on the arrow between HashMap$Entry[] and HashMap$Entry to remove the reference, I receive the message: "Congratulations this object can be garbage collected..." It appears like private instance of Map in SoftCache is holding a strong reference.
    I am not getting an OutOfMemoryError exception.

  • Static class garbage collection

    Can garbage collector can garbage collect static classes ?.
    My doubt is that when you access a static class , that class is loaded through its class loader ( when first time that class is referenced ).
    So when did the garbage collector collects this static class ( assume that static class no longer referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a particular class ( Assume that i m implementing a singleton for my java runtime)
    thanks and regards
    Renjith.

    Can garbage collector can garbage collect static classes ?. Static classes are nothing special in terms of class loading - they are only different in visibility for linking.
    Perhaps you mean static members of classes?
    My doubt is that when you access a static class ,
    that class is loaded through its class loader ( when
    first time that class is referenced ). Classes are always loaded through classloaders. Objects of those classes are allocated from the heap, and the object instances refer to the class object.
    Objects (either instances, or classes themselves) are garbage collected when they are no longer live (i.e. no live object refers to them). (This is a somewhat recursive definition, and sometimes, you can have cyclic dependencies that make garbage collection tricky, but the GC, while it has to be conservative for correctness, usually gets it right).
    So for a static member to be garbage-collected, the class has to be garbage-collected first. The class cannot be GC'ed until all references to it go away (this includes all dynamically allocated objects of that type, and the class loader that loaded that class).
    And yes, class loaders can go away, but only if they are created by your program. The system class loader (which is the default classloader you get if you don't create any class loaders of your own) never goes away, so any class loaded from CLASSPATH will never be unloaded.
    (As an example, servlet containers - e.g. Tomcat, Weblogic, etc.) allocate one or more classloaders for each webapp. When the webapp is un-deployed, the classloaders are "orphaned", and they, and any classes loaded by them (from the WEB-INF/lib and WEB-INF/classes directories) are unloaded and garbage-collected. (After all the dynamic objects of those classes are GC'ed, of course).
    >
    So when did the garbage collector collects this
    static class ( assume that static class no longer
    referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a
    particular class ( Assume that i m implementing a
    singleton for my java runtime)
    thanks and regards
    Renjith.

  • GUI Garbage Collection

    Hi Everyone.
    This is very urgent. I need to perform a possible garbage collection of a heavy GUI stuff when it is not in use. Each of the GUI stuff is created from an action listener for the various menu items. I did try using WeakReference but its very hard to know that when the collection will take place.
    Here is the code snippet for the situation...
    //this is application's main frame class...
    public class MyApplication extends JFrame
    JMenuItem menu1, menu2;
    WeakReference ref_MyPanel;
    //earlier it was a strong reference of MyPanel over here
    public static void main(String [] args)
    //instantiating this class and showing that here ...
    //This is called from menu1's action listener..
    void showGUI()
    JFrame f = new JFrame();
    if(ref_MyPanel.get()!=null)
    f.getContentPane().add((MyPanel)ref_MyPanel.get());
    else
    MyPanel mp = new MyPanel();
    ref_MyPanel=new WeakReference(mp);
    f.getContentPane().add(mp);
    mp=null;//clearing the strong refernce
    f.show();
    //A GUI class which needs to be reclaimed when done
    class MyPanel extends JPanel
    double [] a;
    MyPanel1()
    a = new double [1000000]; //making the panel instance heavy
    What i want is to reclaim the memory occupied by MyPanel instance after its Frame being closed. I even tried calling the System.gc() from the MyPanel instance's parent frame's WindowListener -> windowClosed() but it didn't help. Actually this is suffering me a lot as there are several menu items and several GUIs are being instantiated similar to those of MyPanel as shown above. Do i need to change this design to achieve the objective?
    Can anyone help?

    We saw a significant memory improvement in our system when we used this
    utility. Try using this handy class to recursively remove each component
    For JFrames & JApplets I think it was
    ComponentCleaner.cleanComponent ( myFrame.getContentPane() );
    For Frames & Applets
    ComponentCleaner.cleanComponent ( myFrame );
    Also, for every addActionListener(), addComponentListener() etc call,
    you want a removeActionListener(), removeComponentListener() call.
    The listeners store references to the visual components if I remember rightly. So avoid anonymous listener classes, and have proper cleanup methods to remove the listeners.
    (code below)
    regards,
    Owen
    import java.awt.Container;
    import java.awt.Component;
    import javax.swing.RootPaneContainer;
    public class ComponentCleaner
        public static void cleanComponent(Component baseComponent)
            if (baseComponent == null) // recursion terminating clause
                return ;
            Container cont;
            Component[] childComponents;
            int numChildren;
            // clean up component containers
            if(baseComponent instanceof Container)
                // now clean up container instance variables
                if (baseComponent instanceof RootPaneContainer)
                   // Swing specialised container
                    cont = (Container)baseComponent;
                    numChildren = cont.getComponentCount();
                    childComponents = cont.getComponents();
                    for(int i = 0;i < numChildren;i++)
                        // remove each component from the current container
                        // each child component may be a container itself
                        cleanComponent(childComponents);
    ((RootPaneContainer)cont).getContentPane().remove(childComponents[i]);
    ((RootPaneContainer)cont).getContentPane().setLayout(null);
    else
    { // General Swing, and AWT, Containers
    cont = (Container)baseComponent;
    numChildren = cont.getComponentCount();
    childComponents = cont.getComponents();
    for(int i = 0;i < numChildren;i++)
    // remove each component from the current container
    // each child component may be a container itself
    cleanComponent(childComponents[i]);
    cont.remove(childComponents[i]);
    cont.setLayout(null);
    } // if component is also a container

  • RE unregistering an event listener so it can be garbage-collected

    One good practice in AS 3 is: When you register and event listener with an object, be sure your program also eventually unregisters that listener.
    So, let's say you created an <mx:RemoteObject> and the result listener did its job; you now have the data in an ArrayCollection or something, so you don't need the listener any longer.
    Question: how do you now unregister that result listener?
    Carlos

    That good practice only really applies to long-lived objects with short-lived listeners. Typically, when you are declaring a listener in MXML, it will be a method of your MXML component, so it will not be garbage collected anyway until your component is garbage collected. Normally, this is fine--there is no need to micro-manage the garbage collector unless your listener needs to allocate massive amounts of memory for whatever reason.
    If you really want to do this anyway, you can register the listener as an anonymous function and then call something like
    idOfRemoteObject.removeEventListener(ResultEvent.RESULT, arguments.callee);
    in the listener, but I think this is overkill. When your app is done with the component and the component is elligible for garbage collection, the listener will go with it.

  • High cpu usage for garbage collection (uptime vs total gc time)

    Hi Team,
    We have a very high cpu usage issue in the production.
    When we restart the server, the cpu idle time would be around 95% and it comes down as days goes by. Today idle cpu is 30% and it is just 6th day after the server restart.
    Environemnt details:
    Jrockit version:
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
    BEA WebLogic JRockit(TM) 1.4.2_05 JVM R24.4.0-1 (build ari-38120-20041118-1131-linux-ia32, Native Threads, GC strategy: parallel)
    Gc Algorithm: JRockit Garbage Collection System currently running strategy: Single generational, parallel mark, parallel sweep
    Number Of Processors: 4
    Max Heap Size: 1073741824
    Total Garbage Collection Time: 21:43:56.5
    Uptime: 114:33:4.1
    Total Garbage Collection Count: 420872
    Total Number Of Threads: 198
    Number Of Daemon Threads: 191
    Can you guys please tell me what would be problem in the server which causing the high cpu usage?
    One more thing I would like to know is that why the total number of threads is 198 when we specified the Executor pool size as 25? I agree that weblogic would create some threads for its maintenance but around 160 threads!!! something is wrong I guess.
    Santhosh.
    [email protected]

    Hi,
    I'm having a similar problem, but haven't been able to resolve it yet. Troubleshooting is made even harder by the fact that this is only happening on our production server, and I've been unable to reproduce it in the lab.
    I'll post whatever findings I have and hopefully we'll be able to find a solution with the help of BEA engineers.
    In my case, I have a stand-alone Tomcat server that runs fine for about 1-2 days, and then the JVM suddenly starts using more CPU, and as a result, the server load shoots up (normal CPU utilization is ~5% but eventually goes up to ~95%; load goes from 0.1 to 4+).
    What I have found so far is that this corresponds to increased GC activity.
    Let me list my environment specs before I proceed, though:
    CPU: Dual Xeon 3.06GHz
    RAM: 2GB
    OS: RHEL4.4 (2.6.9-42.0.2.ELsmp)
    JVM build 1.5.0_03-b07 (BEA JRockit(R) (build dra-45238-20050523-2008-linux-ia32, R25.2.0-28))
    Tomcat version 5.5.12
    JAVA_OPTS="-Xms768m -Xmx768m -XXtlasize16k -XXlargeobjectlimit16k -Xverbose:memory,cpuinfo -Xverboselog:/var/log/tomcat5/jvm.log -Xverbosetimestamp"
    Here are excerpts from my verbose log (I'm getting some HT warning, not sure if that's a problem):
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] Detected SMP with 2 CPUs that support HT.
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] Trying to determine if HT is enabled.
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] Trying to read from /dev/cpu/0/cpuid
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] Warning: Failed to read from /dev/cpu/0/cpuid
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] Trying to read from /dev/cpu/1/cpuid
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] Warning: Failed to read from /dev/cpu/1/cpuid
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] HT is: supported by the CPU, not enabled by the OS, enabled in JRockit.
    [Fri Oct 20 15:54:18 2006][22855][cpuinfo] Warning: HT enabled even though OS does not seem to support it.
    [Fri Oct 20 15:54:55 2006][22855][memory ] GC strategy: System optimized over throughput (initial strategy singleparpar)
    [Fri Oct 20 15:54:55 2006][22855][memory ] heap size: 786432K, maximal heap size: 786432K
    [Fri Oct 20 16:07:30 2006][22855][memory ] Changing GC strategy to generational, parallel mark and parallel sweep
    [Fri Oct 20 16:07:30 2006][22855][memory ] 791.642-791.874: GC 786432K->266892K (786432K), 232.000 ms
    [Fri Oct 20 16:08:02 2006][22855][memory ] 824.122: nursery GC 291998K->274164K (786432K), 175.873 ms
    [Fri Oct 20 16:09:51 2006][22855][memory ] 932.526: nursery GC 299321K->281775K (786432K), 110.879 ms
    [Fri Oct 20 16:10:24 2006][22855][memory ] 965.844: nursery GC 308151K->292222K (786432K), 174.609 ms
    [Fri Oct 20 16:11:54 2006][22855][memory ] 1056.368: nursery GC 314718K->300068K (786432K), 66.032 ms
    [Sat Oct 21 23:21:09 2006][22855][memory ] 113210.427: nursery GC 734274K->676137K (786432K), 188.985 ms
    [Sat Oct 21 23:30:41 2006][22855][memory ] 113783.140: nursery GC 766601K->708592K (786432K), 96.007 ms
    [Sat Oct 21 23:36:15 2006][22855][memory ] 114116.332-114116.576: GC 756832K->86835K (786432K), 243.333 ms
    [Sat Oct 21 23:48:20 2006][22855][memory ] 114841.653: nursery GC 182299K->122396K (786432K), 175.252 ms
    [Sat Oct 21 23:48:52 2006][22855][memory ] 114873.851: nursery GC 195060K->130483K (786432K), 142.122 ms
    [Sun Oct 22 00:01:31 2006][22855][memory ] 115632.706: nursery GC 224096K->166618K (786432K), 327.264 ms
    [Sun Oct 22 00:16:37 2006][22855][memory ] 116539.368: nursery GC 246564K->186328K (786432K), 173.888 ms
    [Sun Oct 22 00:26:21 2006][22855][memory ] 117122.577: nursery GC 279056K->221543K (786432K), 170.367 ms
    [Sun Oct 22 00:26:21 2006][22855][memory ] 117123.041: nursery GC 290439K->225833K (786432K), 69.170 ms
    [Sun Oct 22 00:29:10 2006][22855][memory ] 117291.795: nursery GC 298947K->238083K (786432K), 207.200 ms
    [Sun Oct 22 00:39:05 2006][22855][memory ] 117886.478: nursery GC 326956K->263441K (786432K), 87.009 ms
    [Sun Oct 22 00:55:22 2006][22855][memory ] 118863.947: nursery GC 357229K->298971K (786432K), 246.643 ms
    [Sun Oct 22 01:08:17 2006][22855][memory ] 119638.750: nursery GC 381744K->322332K (786432K), 147.996 ms
    [Sun Oct 22 01:11:22 2006][22855][memory ] 119824.249: nursery GC 398678K->336478K (786432K), 93.046 ms
    [Sun Oct 22 01:21:35 2006][22855][memory ] 120436.740: nursery GC 409150K->345186K (786432K), 81.304 ms
    [Sun Oct 22 01:21:38 2006][22855][memory ] 120439.582: nursery GC 409986K->345832K (786432K), 153.534 ms
    [Sun Oct 22 01:21:42 2006][22855][memory ] 120443.544: nursery GC 410632K->346473K (786432K), 121.371 ms
    [Sun Oct 22 01:21:44 2006][22855][memory ] 120445.508: nursery GC 411273K->347591K (786432K), 60.688 ms
    [Sun Oct 22 01:21:44 2006][22855][memory ] 120445.623: nursery GC 412391K->347785K (786432K), 68.935 ms
    [Sun Oct 22 01:21:45 2006][22855][memory ] 120446.576: nursery GC 412585K->348897K (786432K), 152.333 ms
    [Sun Oct 22 01:21:45 2006][22855][memory ] 120446.783: nursery GC 413697K->349080K (786432K), 70.456 ms
    [Sun Oct 22 01:34:16 2006][22855][memory ] 121197.612: nursery GC 437378K->383392K (786432K), 165.771 ms
    [Sun Oct 22 01:37:37 2006][22855][memory ] 121398.496: nursery GC 469709K->409076K (786432K), 78.257 ms
    [Sun Oct 22 01:37:37 2006][22855][memory ] 121398.730: nursery GC 502490K->437713K (786432K), 65.747 ms
    [Sun Oct 22 01:44:03 2006][22855][memory ] 121785.259: nursery GC 536605K->478156K (786432K), 132.293 ms
    [Sun Oct 22 01:44:04 2006][22855][memory ] 121785.603: nursery GC 568408K->503635K (786432K), 71.751 ms
    [Sun Oct 22 01:50:39 2006][22855][memory ] 122180.985: nursery GC 591332K->530811K (786432K), 131.831 ms
    [Sun Oct 22 02:13:52 2006][22855][memory ] 123573.719: nursery GC 655566K->595257K (786432K), 117.311 ms
    [Sun Oct 22 02:36:04 2006][22855][memory ] 124905.507: nursery GC 688896K->632129K (786432K), 346.990 ms
    [Sun Oct 22 02:50:24 2006][22855][memory ] 125765.715-125765.904: GC 786032K->143954K (786432K), 189.000 ms
    [Sun Oct 22 02:50:26 2006][22855][memory ] 125767.535-125767.761: GC 723232K->70948K (786432K), 225.000 ms
    vvvvv
    [Sun Oct 22 02:50:27 2006][22855][memory ] 125768.751-125768.817: GC 712032K->71390K (786432K), 64.919 ms
    [Sun Oct 22 02:50:28 2006][22855][memory ] 125769.516-125769.698: GC 711632K->61175K (786432K), 182.000 ms
    [Sun Oct 22 02:50:29 2006][22855][memory ] 125770.753-125770.880: GC 709632K->81558K (786432K), 126.000 ms
    [Sun Oct 22 02:50:30 2006][22855][memory ] 125771.699-125771.878: GC 708432K->61368K (786432K), 179.000 ms
    So, I'm running with the default GC strategy which lets the GC pick the most suitable approach (single space or generational). It seems to switch to generational almost immediately and runs well - most GC runs are in the nursery, and only once in a while it goes through the older space.
    Now, if you look at [Sun Oct 22 02:50:27 2006], that's when everything changes. GC starts running every second (later on it's running 3 times a second) doing huge sweeps. It never goes through the nursery again, although the strategy is still generational.
    It's all downhill from this point on, and it's a matter of hours (maybe a day) before we restart the server.
    I guess my only question is: What would cause such GC behavior?
    I would appreciate your ideas/comments!
    Thanks,
    Tenyo

Maybe you are looking for

  • Bapi BAPI_REQUISITION_CREATE : how to populate data for sevices tab

    Hi all, I am creating a purchase requisition through bapi .I am using  bapi BAPI_REQUISITION_CREATE For creating purchase requisition. The bapi is  creating PR. I need to add item level services details also through bapi.i am Using structure BAPIESLL

  • IMovie to Premiere: Best workflow for tricky situation?

    Hello, I tried to make a cool title to drag you guys and girls in and possibly find a solution for me. Maybe it is not a super-tricky-situation, but for me it is I have just started working with Premiere, and I love it. I am right now working for a c

  • Illegible concersions from PDF to Word

    My pdfs recently converted to docx format in Word for Mac (runing Yosemite)  are in unreadable characters. Does anyone have an idea of how to reproduce these files so they can be cut and pasted? Otherwise this $23 a year is going to be a big waste. T

  • IMessage sut up

    I have a problem with iMessage on my iPhone4. Normal sms are ok. If I send iMessage to my friend, they received it like from my Apple ID (e-mail) not like sms. iMessages from my friend I didn't receive. But if they answer to my sms(looks like e-mail)

  • Running out of disk space

    My c: drive is 99% full.  I keep getting messages that storage space has exceeded the limit and I cannot sync Google Drive nor can I do a restore process there is not enough space.