13 Replies Latest reply on Oct 3, 2003 2:59 AM by joostdenboer

    memory accumulated

    elisio Newbie

      I´m using jboss 3.0.3 with jdk 1.4.1_01. I setting java parameters -Xmx and -Xincgc at run.sh, but the memory accumulated in few days. Does anyone have any idea how can i liberate the memory??

        • 1. Re: memory accumulated
          estiver estiver Newbie

          Hi,
          Im having the same problem....

          • 2. Re: memory accumulated
            Ryan Ho Newbie

            I'm also having the same problem with JBoss 3.0.4 on RedHat Linux 7.3, but mostly related to hot deployment of EJBs. In other words, my memory consumption (as observed from "top" in Linux) does not go up much during runtime, but goes up 2-5MBs each hot deployment but never comes back down.

            • 3. Re: memory accumulated
              Ryan Ho Newbie

              I'm also having the same problem with JBoss 3.0.4 on RedHat Linux 7.3, but mostly related to hot deployment of EJBs. In other words, my memory consumption (as observed from "top" in Linux) does not go up much during runtime, but goes up 2-5MBs each hot deployment but never comes back down.

              • 4. Re: memory accumulated
                Tim McCune Novice

                We're having the same problem here. JBoss 3.0.4 under JDK 1.4.1_01, RH 7.3. Our ear file is 14 MB and every redeployment of it causes JBoss memory utilization to jump by approximately 30 MB until eventually the JVM throws Out Of Memory errors. Here's a sample stack trace if it helps.

                2003-02-08 19:14:44,762 ERROR [STDERR] java.lang.OutOfMemoryError
                2003-02-08 19:14:44,763 ERROR [STDERR] at java.util.zip.ZipFile.open(Native Method)
                2003-02-08 19:14:44,763 ERROR [STDERR] at java.util.zip.ZipFile.(ZipFile.java:112)
                2003-02-08 19:14:44,763 ERROR [STDERR] at java.util.jar.JarFile.(JarFile.java:117)
                2003-02-08 19:14:44,763 ERROR [STDERR] at java.util.jar.JarFile.(JarFile.java:55)
                2003-02-08 19:14:44,763 ERROR [STDERR] at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:576)
                2003-02-08 19:14:44,763 ERROR [STDERR] at sun.misc.URLClassPath$JarLoader.(URLClassPath.java:541)
                2003-02-08 19:14:44,764 ERROR [STDERR] at sun.misc.URLClassPath$3.run(URLClassPath.java:319)
                2003-02-08 19:14:44,764 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
                2003-02-08 19:14:44,764 ERROR [STDERR] at sun.misc.URLClassPath.getLoader(URLClassPath.java:308)
                2003-02-08 19:14:44,764 ERROR [STDERR] at sun.misc.URLClassPath.getLoader(URLClassPath.java:285)
                2003-02-08 19:14:44,764 ERROR [STDERR] at sun.misc.URLClassPath.findResource(URLClassPath.java:136)
                2003-02-08 19:14:44,764 ERROR [STDERR] at java.net.URLClassLoader$2.run(URLClassLoader.java:351)
                2003-02-08 19:14:44,764 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
                2003-02-08 19:14:44,764 ERROR [STDERR] at java.net.URLClassLoader.findResource(URLClassLoader.java:348)
                2003-02-08 19:14:44,764 ERROR [STDERR] at java.lang.ClassLoader.getResource(ClassLoader.java:780)
                2003-02-08 19:14:44,765 ERROR [STDERR] at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:941)
                2003-02-08 19:14:44,765 ERROR [STDERR] at org.jboss.deployment.EARDeployer.init(EARDeployer.java:98)
                2003-02-08 19:14:44,765 ERROR [STDERR] at org.jboss.deployment.MainDeployer.init(MainDeployer.java:673)
                2003-02-08 19:14:44,765 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:609)
                2003-02-08 19:14:44,765 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
                2003-02-08 19:14:44,765 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
                2003-02-08 19:14:44,765 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                2003-02-08 19:14:44,765 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
                2003-02-08 19:14:44,765 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                2003-02-08 19:14:44,766 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                2003-02-08 19:14:44,766 ERROR [STDERR] at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                2003-02-08 19:14:44,766 ERROR [STDERR] at $Proxy4.deploy(Unknown Source)
                2003-02-08 19:14:44,766 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
                2003-02-08 19:14:44,766 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
                2003-02-08 19:14:44,766 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
                2003-02-08 19:14:44,766 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
                2003-02-08 19:14:44,766 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
                2003-02-08 19:14:44,767 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)

                • 5. Re: memory accumulated
                  Ryan Ho Newbie

                  Hi, I've posted a similar question to JGuru (on Weblogic, apparently a similar problem exists on Weblogic as well) and haven't got an answer, and Internet searches didn't provide any answers either. It's been frustrating us for a while though it doesn't have a major impact on our production systems as we don't hot deploy every other day anyway, but having to restart JBoss 3 times a day on our development box hardly inspires confidence if you know what I mean :)

                  It'll be great if someone can drop by and give us the answer but given that I've been asking this question for some time and haven't got any answer I'm not counting on that, so we may have to help ourselves and each other here.

                  Anyway, we're working on a solution (i've started to do some memory profiling and stuff), but I think we'll get more mileage from working together. If anyone is keen on working together and sharing information please email me at ryanho@dfkjtech.com

                  • 6. Re: memory accumulated
                    Tim McCune Novice

                    Thanks, I tend to agree. We've been discussing it a bit here and doing a little profiling. The problem seems related to class loading. It appears that the custom classloader that the deployer creates is maybe not getting cleaned up because there is a reference to it somewhere. I'm wondering if there might be a 3rd-party library that we're both using that is doing something inappropriate. It would have to be something that gets invoked upon deployment because I don't have to actually execute any calls on my beans for this to happen. We're using aspectj, jakarta's commons-logging, and log4j, all of which have lots of stuff invoked on deployment. Are you using any of these? I tried taking log4j out of the picture by configuring commons-logging to just use its simple logger, but the leak persisted. I'll continue to do some profiling and researching on this end. Good luck.

                    • 7. Re: memory accumulated
                      Tim McCune Novice

                      Been doing a little investigation. The problem seems to also occur on Solaris, but NOT on Windows XP, same JVM version. Also tracked down the fact that it appears to be pieces of the jars contained in our deployment that are hanging around. Specifically, java.util.jar.JarFile$JarFileEntry, java.util.jar.Attributes, and java.util.jar.Manifest. I've dug through the JBoss code and can't find any places where the deployer is saving off references to these things. The Windows thing makes me suspicious that it's a problem somewhere inside the JVM that the deployer code is exposing. Ryan, can you possibly try recreating your problem on Windows and see if it still occurs?

                      • 8. Re: memory accumulated
                        Wenwei Xie Newbie

                        I had the exact same problem using JBoss 3.0.6 with Tomcat 4.1.18 on Linux 7.3 (JDK1.3) as "javajedi" above, with OutofMemoryError. My ear file is very small (less than 1MB), I checked the memory usage on the server, JBoss used about 400MB and the server has 4GB physical memory. Any one here has any clue? Should I increase the JVM memory and how? Thanks very much.

                        --Wenwei

                        • 9. Re: memory accumulated
                          Wenwei Xie Newbie

                          I had the exact same problem using JBoss 3.0.6 with Tomcat 4.1.18 on Linux 7.3 (JDK1.3) as "javajedi" above, with OutofMemoryError. My ear file is very small (less than 1MB), I checked the memory usage on the server, JBoss used about 400MB and the server has 4GB physical memory. Any one here has any clue? Should I increase the JVM memory and how? Thanks very much.

                          • 10. Re: memory accumulated
                            Bryan Lewis Newbie

                            I have the same problem with JBoss-3.05_tomcat-4.1.18 on Solaris. Repeatedly undeploying and redeploying a 2.6 MB ear file causes memory usage to grow by about 5 megs each time (as observed in 'top'). Eventually I get the 'Out of Memory' error if I don't restart the server.

                            I searched the bug list on sourceforge and found this old bug:
                            http://sourceforge.net/tracker/index.php?func=detail&aid=435958&group_id=22866&atid=376685

                            It was closed with the comment "Unfortunately
                            memory is always limited and therefore hot deployment will one time reach a limit because all the loaded classes are not removed from the classloaders." Perhaps if someone pins it down better, the bug could be reopened.


                            • 11. Re: memory accumulated
                              Ken Hammond Newbie

                              We are getting what appears to be the same problem using jboss-3.0.4_tomcat-4.1.12 on a Red Hat Linux 7.1 box. We are getting out of memory exceptions at least once daily. Not sure yet whether it is related to deployment of jars.

                              However, one thing we did discover about deployment that was very important is that when you deploy multiple jars, deploy them one at a time and allow jboss to undeploy the old jar and redeploy the new one before starting the next one. When we copied the whole bunch over at once, jboss just couldn't sort it all out and it led to a lot of instability.

                              • 12. Re: memory accumulated
                                miss_paddy Newbie

                                Hi we have the same problem.... we 're working with m using jboss 3.2.2RC3 with jdk 1.3.1_01 and now we are trying to optimizate code to reduce the increasing memory because we don't Know how to do. Even if it wasn't successfull, epereira, can I Know how you have setting java parameters -Xmx and -Xincgc?
                                Is tehre anyone that have any new idea to liberate memory?? I start to think that this was an insite JBoss problem ....
                                thanks for every help
                                MP

                                • 13. Re: memory accumulated
                                  joostdenboer Newbie

                                  Anyone found a solution to this problem yet?
                                  I'm having the same problem, memory accumulation with hotdeployment, with jboss-3.2.1_tomcat-4.1.24 on a Win2000 machine !
                                  So I guest windows is not off the hook here.

                                  Any ideas ?

                                  Joost