dplyukhin / UIGC

A garbage collector for Akka actors!
Other
4 stars 2 forks source link

Integrating termination detection to our GC #21

Closed dplyukhin closed 11 months ago

dplyukhin commented 4 years ago

Next step towards #7 (after completing #20) is to have actors periodically send their snapshots to the termination detector process. I see two possible approaches:

  1. Register a special "termination detector" actor as a receptionist. Actors periodically look up the termination detector actor and send it their local snapshot.
  2. Register a shared ConcurrentHashMap as an Akka extension. Actors periodically store their latest snapshot in this hashmap. Periodically, a GC process wakes up and scans the entire hashmap to detect terminated actors.

Which one of these do we want to do first?

Miscellaneous thoughts on timers

To reduce contention, actors should randomize the time they wait before taking a snapshot. We can also implement a "generational" strategy where actors wait longer and longer before taking their next snapshot, since older actors are less likely to be garbage.

Timers might be a bottleneck altogether, depending on how Akka implements them. An alternate strategy besides this one might be to periodically traverse the actor supervisor tree, requesting a snapshot from each actor in the tree.

References