documentation question on jumi actors

Skip to first unread message

Manav Brar

Jul 29, 2016, 12:36:17 PM7/29/16
to Jumi Test Runner
all the documentation on jumi actors start with Executors.newCachedThreadPool() which are considered problematic
1) It's unbounded, which means that you're opening the door for anyone to cripple your JVM by simply injecting more work into the service (DoS attack). Threads consume a non-negligible amount of memory and also increase memory consumption based on their work-in-progress, so it's quite easy to topple a server this way (unless you have other circuit-breakers in place).

2) The unbounded problem is exacerbated by the fact that the Executor is fronted by a SynchronousQueue which means there's a direct handoff between the task-giver and the thread pool. Each new task will create a new thread if all existing threads are busy. This is generally a bad strategy for server code. When the CPU gets saturated, existing tasks take longer to finish. Yet more tasks are being submitted and more threads created, so tasks take longer and longer to complete. When the CPU is saturated, more threads is definitely not what the server needs.

could you please address these concerns as time permits

Reply all
Reply to author
0 new messages