5 Replies Latest reply on Feb 10, 2010 11:39 AM by Peter Johnson

    Possible Memory Leak

    Mayank Mittal Novice

      Hi All,

          I am using Jboss 4.2.3 with Sun JDK 1.6.0_18 on a 32-bit Debian Linux with 4G of RAM.

         My application is a write insentive application and updates database on every 3 sec.

         Now my problem is that, after few hours of running the application, the RSS size starts growing and it has been noticed that it even touches <1G, although the heap remains at 50%.

       

      I am running the server with following configuration.

        

      export JAVA_OPTS="$JAVA_OPTS -XX:-UseGCOverheadLimit -XX:GCTimeRatio=15 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:-HeapDumpOnOutOfMemoryError -XX:MaxPermSize=128m -Xss128k -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 "

       

      ./run.sh -b $SERVER_IP -c all

       

      Is there any thing else, which I am missing , or is it a memory leak in the Java itself?.

        • 1. Re: Possible Memory Leak
          Peter Johnson Master

          Does this post reflect the same thing you are seeing:

          http://community.jboss.org/thread/146579

          • 2. Re: Possible Memory Leak
            Mayank Mittal Novice

            peterj wrote:

             

            Does this post reflect the same thing you are seeing:

            http://community.jboss.org/thread/146579

            Yes, The problem is almost similar to that of what explained in the specified post, but with few discrepancies, in the specified post, the guy starts facing problem when he upgrade its AS from JBoss 4.2.3 to JBoss 5.1.0. But I'm facing the problem on Jboss 4.2.3, evev i tried with the latest JVM version 1.6.0u18, But the outcome is the same.

            • 3. Re: Possible Memory Leak
              Peter Johnson Master
              I don't know enough about the debugging tools available on Linux to provide much help. The only thing that comes to mind is to use a C/C++ debugger attached to the java process to see if that helps identify where and why the memory is being allocated.
              • 4. Re: Possible Memory Leak
                Mayank Mittal Novice

                peterj wrote:

                 

                I don't know enough about the debugging tools available on Linux to provide much help. The only thing that comes to mind is to use a C/C++ debugger attached to the java process to see if that helps identify where and why the memory is being allocated.

                 

                I used Yourkit profiler as well as JBuilder to profile the application, but any kind of memory leak is not visible, also the memory consumption keeps on increasing.

                 

                 

                The one thing I noticed after long term execution of my server, is that, after consuming 67% of memory, linux starts using swap memory instead of RAM. Can you throw some light on this behavior of the Linux.

                • 5. Re: Possible Memory Leak
                  Peter Johnson Master

                  Yourkit and JBuilder are Java debuggers. I wrote that you need to us a C/C++ debugger and debug the JVM itself. That is the only way you can track down a memory leak that is occurring somewhere other than in the heap or permgen.

                   

                  Linux tends to use RAM only until the RAM usage is at a certain level, at which time it starts using the swap space. It will never use 100% of RAM (or at least ot should not be configured to) because it needs to keep some free room for loading in new apps. I do not know what configuration setting governs this, google might provide enlightenment.