5 Replies Latest reply on Aug 25, 2004 10:58 PM by Clebert Rezende Suconic

    Memory problems?

    benstarr Newbie

      I have a large J2EE application which serves a number of websites and also periodically performs complex background tasks using JMS, MDBs, stateless session beans and entity beans. I have allocated a minimum of 128MB to the application and a maximum of 1GB. However, even when the application is idle and I force a garbage collection (through the console application) it is still consuming 400MB of memory (half of which is free). Is it usual to expect a complex application to consume 200MB of memory at idle time? I really don't know what is taking up all this memory. It isn't a problem at the moment because it can use up to 1GB but I am wondering if it is an indication of a memory problem. Unfortunately I am running on Max OS 10.3 Server so most of the profiling tools available do not work. Any information or suggestions would be much appreciated.

      Ben

        • 1. Re: Memory problems?
          benstarr Newbie

          More information...

          I am running JBoss 3.2.3 on Java 1.4.2.

          The MDBs and Session Beans that perform the background processing perform fairly heavy file IO on a scheduled bases (local file IO and network file IO). I'm pretty much convinced that the memory problems are related to this part of the application. However, I am ensuring that all of my file handles are correctly closed and none of them are declared outside the scope of an individual method.

          I'm also pretty sure that it is a memory "leak" since the amount of memory used grows each time I run the scheduled task and is not fully recovered when I force a garbage collection. I know that the EJB spec does not recommend file IO within EJBs but this application is very file based and a database is not really a viable alternative. Any help in possible ways to pinpoint this problem would be appreciated.

          • 2. Re: Memory problems?
            Julien Dubois Newbie

            You should *not* do IO from an EJB. You're breaking the ACIDity, just anything can go wrong. And I really wonder why you think a database is not an alternative.
            Anyway....
            You should definitly have a look at why you need so much memory. This is not a JBoss-related problem, it's whatever strange thing you do with your app that takes up all the memory.
            Concerning the profiling tools, have a look again. Or run your app on Windows/Linux, JBoss works perfectly well on those environnement. Don't tell me your app only works on OS X.....

            • 3. Re: Memory problems?
              rfn Newbie

              You might want to off load the background processing to another dedicated server?

              "benstarr" wrote:
              I have a large J2EE application which serves a number of websites and also periodically performs complex background tasks using JMS, MDBs, stateless session beans and entity beans. I have allocated a minimum of 128MB to the application and a maximum of 1GB. However, even when the application is idle and I force a garbage collection (through the console application) it is still consuming 400MB of memory (half of which is free). Is it usual to expect a complex application to consume 200MB of memory at idle time? I really don't know what is taking up all this memory. It isn't a problem at the moment because it can use up to 1GB but I am wondering if it is an indication of a memory problem. Unfortunately I am running on Max OS 10.3 Server so most of the profiling tools available do not work. Any information or suggestions would be much appreciated.

              Ben


              • 4. Re: Memory problems?
                Jamie Burns Newbie

                Ive been having a similar problem. I found a few things posted on the various jboss forums/faqs/wikis that have helped ease the problem.

                Found a warning about hsqldb and advise to change the JMS persistence to something else here:

                http://www.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMQDB

                Found some advise about changing the cache size for CMP from the default 1000000 objects:

                http://www.jboss.org/index.html?module=bb&op=viewtopic&t=49440

                Found advise about setting the size of the permanent heap size:

                http://www.jboss.org/wiki/Wiki.jsp?page=OutOfMemoryExceptions

                • 5. Re: Memory problems?
                  Clebert Rezende Suconic Newbie

                  Why you guys don't try to use jboss-profiler.

                  It's a new project inside JBoss, but I have worked on this for one year now, and it's pretty stable.

                  I know that the front-end (which is based on a Web application) doesn't have the best design approach, but it has all information you might need.

                  For example, you can find where your memory are being created, and what methods are not releasing the memory initially allocated.

                  The only problem now, is that you have to download it directly from CVS but it's easy to compile it. It requires ant+Java only, and it takes 1 minute to compile it.

                  I can help over this forum or jboss-profiler forum with issues about it.


                  Clebert