getting out of memory - not able to create new native threads in akka java

24 views
Skip to first unread message

Jitu Thakur

unread,
Jul 26, 2016, 12:27:58 PM7/26/16
to Akka User List

Hi,


In our system we have a few blocking actors(service calls) and we were using default dispatcher, but when we increase load the system becomes very slow and we observed that the message waits a long time to reach to next actor (which means dispatcher is taking time to transfer messages) Even though the next actor is sitting idle.


In order to solve this we used Pinned dispatcher for Actors which had blocking calls. But we noticed that for each actor instance a pinned-dispatcher instance was created, and after processing few messages application crashes with OutOfMemory Error.

We also tried Balancing dispatcher but again it ends up with OutOfMemory.


As Pinned dispatcher is the best suited for Blocking call actors, is there a limit to the no of instances of Actors for each actor type. Is there any property through which we limit the no of instances of pinned dispatcher.

Or any other better approach which will be best suited to our application.


Thanks,

JT

Akka Team

unread,
Jul 27, 2016, 10:36:52 AM7/27/16
to Akka User List
Hi Jitu

The thread pool based dispatcher is best suited to isolate blocking actors from the rest of the system, it has an upper limit on the number of threads you can set with max-pool-size-max so you can guarantee that the number of threads are not growing without control.

Getting OutOfMemory errors could be for many reasons, a common reason I have seen in Akka applications is accepting work at a higher rate into your application than it can process, and do not back pressure or have bounded queues you will fill memory up with messages queued in the actor mailboxes, if this is your problem the choice of dispatcher will not help you with your problems much. 

I'd recommend you to profile the system under load and make sure you understand what is actually going on rather than tweaking settings in hopes of solving the problem.

--
Johan

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages