spray, akka - java.lang.OutOfMemoryError: unable to create new native thread

327 views
Skip to first unread message

Rahul Dev

unread,
Jun 29, 2015, 7:53:58 AM6/29/15
to spray...@googlegroups.com
While checking the throughput of spray api.

Scenario: 25 concurrent users

Os: Free BSD

Memory: 2GB

No Of Cores: 2

At around 10 concurrent users system started giving following error.


[ERROR] [06/29/2015 05:01:56.407] [default-akka.actor.default-dispatcher-2]     [ActorSystem(default)] Uncaught error from thread [default-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
    java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:714)
        at scala.concurrent.forkjoin.ForkJoinPool.tryAddWorker(ForkJoinPool.java:1672)
        at scala.concurrent.forkjoin.ForkJoinPool.deregisterWorker(ForkJoinPool.java:1795)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:117)




Akka and Spray Conf changes from default:

    akka{
   tcp{
   register-timeout = 20s
   }
    }

    spray.can {
   request-timeout = 30 s
   bind-timeout = 30s
        unbind-timeout = 5s
        registration-timeout = 30s
    }

    http.spray.can {
   server{
    pipelining-limit = 50
   }
    }


What is causing the OutOfMemmoryError. The exception is thrown from the router actor

Mathias Doenitz

unread,
Jun 30, 2015, 4:29:58 AM6/30/15
to spray...@googlegroups.com
Rahul,

> What is causing the OutOfMemmoryError. The exception is thrown from the router actor

without knowing anything more about your application it will be impossible for us to answer your question.
An OOME is often caused by a memory leak of some kind.
In this case I’d assume that the root cause is somewhere in your application code rather than spray.
Maybe you are not stopping all the actors that you are spawning?

Cheers,
Mathias

---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spray-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/b47ca251-82a5-40f1-95da-ba99e3ab8ac2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages