I'm having problems deployments a WAR in JBoss EAP 7.0.0. This war is based on an Spring application.
After deploying and removing the WAR 3 or 4 times, I get an OutOfMemoryError exception:
17:02:37,643 ERROR [stderr] (Thread-223) Exception in thread "Thread-223" java.lang.OutOfMemoryError: Java heap space
17:02:37,645 ERROR [stderr] (Thread-223) at io.netty.util.internal.PlatformDependent.allocateUninitializedArray(PlatformDependent.java:189)
17:02:37,645 ERROR [stderr] (Thread-223) at io.netty.buffer.PoolArena$HeapArena.newByteArray(PoolArena.java:676)
17:02:37,645 ERROR [stderr] (Thread-223) at io.netty.buffer.PoolArena$HeapArena.newChunk(PoolArena.java:686)
17:02:37,646 ERROR [stderr] (Thread-223) at io.netty.buffer.PoolArena.allocateNormal(PoolArena.java:244)
17:02:37,646 ERROR [stderr] (Thread-223) at io.netty.buffer.PoolArena.allocate(PoolArena.java:226)
17:02:37,646 ERROR [stderr] (Thread-223) at io.netty.buffer.PoolArena.allocate(PoolArena.java:146)
17:02:37,646 ERROR [stderr] (Thread-223) at io.netty.buffer.PooledByteBufAllocator.newHeapBuffer(PooledByteBufAllocator.java:307)
17:02:37,647 ERROR [stderr] (Thread-223) at io.netty.buffer.AbstractByteBufAllocator.heapBuffer(AbstractByteBufAllocator.java:162)
17:02:37,647 ERROR [stderr] (Thread-223) at io.netty.buffer.AbstractByteBufAllocator.heapBuffer(AbstractByteBufAllocator.java:153)
17:02:37,647 ERROR [stderr] (Thread-223) at io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:135)
17:02:37,648 ERROR [stderr] (Thread-223) at io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator$MaxMessageHandle.allocate(DefaultMaxMessagesRecvByteBufAllocator.java:80)
17:02:37,648 ERROR [stderr] (Thread-223) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:122)
17:02:37,648 ERROR [stderr] (Thread-223) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
17:02:37,648 ERROR [stderr] (Thread-223) at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:544)
17:02:37,649 ERROR [stderr] (Thread-223) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)
17:02:37,649 ERROR [stderr] (Thread-223) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
17:02:37,649 ERROR [stderr] (Thread-223) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
17:02:37,649 ERROR [stderr] (Thread-223) at java.lang.Thread.run(Thread.java:748)
17:04:30,709 ERROR [stderr] (MyThread_ViewsDtoGeneration) Exception in thread "MyThread_ViewsDtoGeneration" java.lang.OutOfMemoryError: GC overhead limit exceeded
17:04:30,711 ERROR [stderr] (MyThread_ViewsDtoGeneration) at java.util.Arrays.copyOfRange(Arrays.java:3664)
17:04:30,711 ERROR [stderr] (MyThread_ViewsDtoGeneration) at java.lang.String.<init>(String.java:207)
17:04:30,711 ERROR [stderr] (MyThread_ViewsDtoGeneration) at java.lang.StringBuilder.toString(StringBuilder.java:407)
17:04:30,712 ERROR [stderr] (MyThread_ViewsDtoGeneration) at org.hibernate.dialect.Dialect.applyLocksToSql(Dialect.java:1439)
17:04:30,712 ERROR [stderr] (MyThread_ViewsDtoGeneration) at org.hibernate.loader.plan.exec.query.internal.SelectStatementBuilder.toStatementString(SelectStatementBuilder.java:222)
17:04:30,712 ERROR [stderr] (MyThread_ViewsDtoGeneration) at org.hibernate.loader.plan.exec.internal.AbstractLoadQueryDetails.generate(AbstractLoadQueryDetails.java:183)
17:04:30,712 ERROR [stderr] (MyThread_ViewsDtoGeneration) at org.hibernate.loader.plan.exec.internal.EntityLoadQueryDetails.<init>(EntityLoadQueryDetails.java:90)
17:04:30,712 ERROR [stderr] (MyThread_ViewsDtoGeneration) at org.hibernate.loader.plan.exec.internal.BatchingLoadQueryDetailsFactory.makeEntityLoadQueryDetails(BatchingLoadQueryDetailsFactory.java:61)
...
I used VisualVM to analyze what's happening in the server, and I realized that the number loaded Classes was increased in each deployment (that's OK) but it doesn't decrease when I remove the application.
Also the number of threads seems to be increased each time, but never decreased the same amount of threads created during the deployment.
I don't really know what is happening. I test the same application in a Tomcat 8.5.24, and I never get this error, and that makes me think that the error is not in my application, but who knows...
Any idea? Thanks!