Open devas123 opened 2 years ago
When creating a new actor in the following code:
https://github.com/zio/zio-actors/blob/1560ff2d2cc000cf36313b5ebf659467f5a5a191/actors/src/main/scala/zio/actors/ActorSystem.scala#L132-L143
If the actor stops and calls dropFromActorMap before it gets added to the actor map at line 143, the map will be updated with a reference to a dead actor, which creates a memory leak.
dropFromActorMap
A quick solution could be to pass a Promise to the dropFromActorMap, which will be resolved after the map has been updated.
When creating a new actor in the following code:
https://github.com/zio/zio-actors/blob/1560ff2d2cc000cf36313b5ebf659467f5a5a191/actors/src/main/scala/zio/actors/ActorSystem.scala#L132-L143
If the actor stops and calls
dropFromActorMap
before it gets added to the actor map at line 143, the map will be updated with a reference to a dead actor, which creates a memory leak.