He-Pin opened a new pull request, #3031: URL: https://github.com/apache/pekko/pull/3031
### Motivation An ActorGraphInterpreter starts with an initial shell but can host additional ones created using the subfusing materializer. The lifetime of ActorGraphInterpreter is not tied to the lifetime of the initial interpreter. However, a reference to the initial GraphInterpreterShell is kept around in the _initial constructor parameter, which can lead to unexpected memory usage because the initial GraphInterpreter and all its logics might be kept referenced much longer than expected. This issue was originally reported in akka/akka-core#23535. ### Modification - Changed _initial from val to private var - Set _initial to null after initialization in preStart() - Fixed debug logging to use shell parameter instead of _initial ### Result ActorGraphInterpreter no longer keeps a reference to the initial interpreter shell after it has been shut down, allowing it and its logics to be garbage collected even when the actor is still alive hosting other subfused interpreters. ### Tests - Added test to verify initial shell reference is released after completion - Added test to verify actor can host additional interpreters after initial shell completes ### References - Fixes #1235 (ActorGraphInterpreter keeps reference to initial shell) - Related to akka/akka-core#23535 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
