简体   繁体   中英

Tomcat won't deploy an application due low java heap memory

I want to deploy my .war (cca 55MB) application to apache tomcat 7 application server, nevertheless the deployment fails. When I try to deploy some smaller .war archive (cca 4MB), it finishes without any problem. I've tried to increase java heap space and now it should be quite enough. Moreover after the attempt to deploy this .war , even tomcat manager crashes. I'd be glad for any suggestion how to solve this.

root@vm15187:~# java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
uintx AdaptivePermSizeWeight                    = 20              {product}
 intx CompilerThreadStackSize                   = 0               {pd product}
uintx ErgoHeapSizeLimit                         = 0               {product}
uintx HeapSizePerGCThread                       = 87241520        {product}
uintx InitialHeapSize                          := 65019648        {product}
uintx LargePageHeapSizeThreshold                = 134217728       {product}
uintx MaxHeapSize                              := 1042284544      {product}
uintx MaxPermSize                               = 174063616       {pd product}
uintx PermSize                                  = 21757952        {pd product}
 intx ThreadStackSize                           = 1024            {pd product}
 intx VMThreadStackSize                         = 1024            {pd product}
 java version "1.7.0_75"
 OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~deb7u1)
 OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

In my catalina.out log are these error messages:

SEVERE: Error waiting for multi-thread deployment of WAR files to complete
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space


SEVERE: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0}
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space

Full log here

You need to continue increasing the memory allocation -XmxNNNNm until it works and then use a memory analysis tool to learn what is consuming it. In my experience a 55MB WAR file is a sizeable application.

Note that you should use:

CATALINA_OPTS="-Xms..."

instead of JAVA_OPTS. This latter environment variable is applied to all java processes that are launched to support Tomcat. CATALINA_OPTS is only applied to the server process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM