3 Replies Latest reply on Feb 26, 2007 2:58 PM by jpoportela

    Out of Memory Error while performing Application deployment

    jpoportela

      Hi,

      I'm having a problem in a Production environment with OutOfMemoryError errors during applications deployment.
      This is critical since after this error no more deployment can be performed and a JBoss restart is necessary.


      To understand which was the problem I've performed some simple application deployments (and undeployments) to
      check if I had the problem. The same error occurred with this basic application (hello world)!!!

      In this basic test, with a basic application, I've used a script to deploy and undeploy the application a given number of times.

      While monitorizing JBoss java process with linux's top, I can see that the virtual memory for the java/jboss
      process raises constantly during the (massive deployment) test and when reaches 3G OutOfMemoryError errors appear.

      Here is a stack trace example (of JBoss's server.log):

      14:02:38,797 ERROR [MainDeployer] Could not initialise deployment: file:/opt/jboss-4.0.5.GA/server/default/deploy/Test49418.ear
      java.lang.OutOfMemoryError
      at java.util.zip.Inflater.init(Native Method)
      at java.util.zip.Inflater.(Inflater.java:75)
      at java.util.zip.ZipFile.getInflater(ZipFile.java:375)
      at java.util.zip.ZipFile.getInputStream(ZipFile.java:320)
      at java.util.zip.ZipFile.getInputStream(ZipFile.java:286)
      at java.util.jar.JarFile.getInputStream(JarFile.java:387)
      at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:136)
      at java.net.URL.openStream(URL.java:1007)
      at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1161)
      at org.jboss.deployment.EARDeployer.init(EARDeployer.java:131)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      14:02:43,807 INFO [EARDeployer] Init J2EE application: file:/opt/jboss-4.0.5.GA/server/default/deploy/Test49418.ear


      While trying to understand, I've performed a test of making 1000 deploys and undeploys, and taken memory snapshots before and after the test.
      This snapshot shows a proportional increase of some objects, for instance, URLJarFile and URL.
      It seams to me that the undeployment is not cleaning up everything, and for each deployment java process virtual memory increases.

      I packed relavant files in filesTest49418.zip
      ( files: the test application source and ear , memory snapshot differences).


      Environment:
      RedHat Linux,
      Java JDK 5 (update 10)
      JBoss version 4.0.5 (also tested in 4.0.3SP1).

      Can anyone help me with this problem (possible memory leak on deployment).


      Best regards,

      João Portela