I have a akka actor which read from hazelcast and builds a Map[id:String, Set[val:String]]
. Now i want to traverse this map and put the following tuple ((id, val))(true)
into Scala caffeine cache (another actor). How can i achieve this without blocking? The map is huge (millions of record)
Asked
Active
Viewed 591 times
1

nocturnal
- 395
- 2
- 6
- 15
-
1What is blocking your code from traversing the dataset ? – Constantine Aug 21 '18 at 04:37
-
traversing Map and writing to cache takes a lot of time and docker goes OOM with Cluster Node [akka.tcp://rapids@10.2.9.30:2551] - Scheduled sending of heartbeat was delayed. Previous heartbeat was sent [37373] ms ago, expected interval is [5000] ms. This may cause failure detection to mark members as unreachable. The reason can be thread starvation, e.g. by running blocking tasks on the default dispatcher, CPU overload, or GC. – nocturnal Aug 21 '18 at 04:49
-
The fact that you're ooming and having thread starvation while running in a docker container indicates to me that GC (and its interaction with running in a docker container allocated with far less than all of the host CPUs) is the problem more than blocking. – Levi Ramsey Aug 21 '18 at 13:33
-
@nocturnal did you ever figure this out? I'm having same issue outside of docker. – Omnipresent Dec 24 '18 at 13:50