Closed wwerner closed 5 years ago
Stepping through the issue several times, the cause seems to be an OOM thrown from
ElasticResourcePool.initialize
(when creating the third pool w/ each 100 minIdle)
java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
at io.vlingo.wire.message.ByteBufferAllocator.allocate(ByteBufferAllocator.java:17)
at io.vlingo.wire.message.BasicConsumerByteBuffer.<init>(BasicConsumerByteBuffer.java:23)
at io.vlingo.wire.message.ConsumerByteBufferPool$PoolAwareConsumerByteBuffer.<init>(ConsumerByteBufferPool.java:72)
at io.vlingo.wire.message.ConsumerByteBufferPool$ConsumerByteBufferFactory.create(ConsumerByteBufferPool.java:49)
at io.vlingo.wire.message.ConsumerByteBufferPool$ConsumerByteBufferFactory.create(ConsumerByteBufferPool.java:31)
at io.vlingo.common.pool.ElasticResourcePool.initialize(ElasticResourcePool.java:64)
at io.vlingo.common.pool.ElasticResourcePool.<init>(ElasticResourcePool.java:58)
at io.vlingo.common.pool.ElasticResourcePool.<init>(ElasticResourcePool.java:51)
at io.vlingo.wire.message.ConsumerByteBufferPool.<init>(ConsumerByteBufferPool.java:28)
at io.vlingo.wire.channel.SocketChannelSelectionProcessorActor.<init>(SocketChannelSelectionProcessorActor.java:55)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:406)
at io.vlingo.actors.Actor.childActorFor(Actor.java:181)
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannelActor.startProcessors(ServerRequestResponseChannelActor.java:161)
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannelActor.<init>(ServerRequestResponseChannelActor.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
After some debugging w/ @VaughnVernon we found the cause. Recording it here for traceability.
SocketChannelSelectionProcessorActor
creates an ElasticResourcePool
for each instance, which, at some point throws an OOM
which is swallowed around io/vlingo/actors/ActorFactory.java:121
and thus was never visible in stack traces.
Vaughn is currently resolving it, I'll re-test and close this issue afterwards.
After pulling the changes of all dependencies (updates between 2019-10-30 and 2019-11-08), the server fails to start with the exception below.
The corresponding test
io.vlingo.schemata.BootstrapTest#testThatBootstrapStartsServerCleanly
also fails.I checked whether the
Definition
args match the Actor's c'tor as indicated in the exception, but they do, see screenshot below.Instead, the exception seems to be thrown during initialization of
ServerActor
from theActor
super c'tor when trying to create a newTestEnvironment
. Inio/vlingo/actors/testkit/TestEnvironment.java:17
,TestWorld.Instance.get().world().stage()
throws an NPE asTestWorld.Instance.get()
returnsnull
.This happens in the unit tests as well as when running the application in
dev
orprod
modes. In the latter cases, is it correct that noActorFactory.threadLocalEnvironment
is found?