Memory leak in a long-running program that spawns actors #1455
-
Hi there! I also shared this question on spectrum (see https://spectrum.chat/statecharts/general/memory-leak-in-xstate-when-spawning-actors~edb45f68-c6d9-4cc0-b2fa-d1d73f314e0d ),but I thought I would be useful for xstate users to see my question asked here. So, here is the problem I'm facing : We have a component in production that orchestrates some operations on our infrastructure, and we used XState for that component. Recently, we noticed that it was rebooting regularly because of a memory leak, so I'd like to understand where it comes from. So my question is : if stopping the actor is not enough to free the memory, what is? I'm not sure what's necessary in order to make some room for new and active actors |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Please see #1434 . It most likely answers your questions. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think this may be an issue on our side - calling |
Beta Was this translation helpful? Give feedback.
Yeah, I think this may be an issue on our side - calling
someActor.stop()
currently does not notify the parent that the actor should be removed (and GC'd). I'll look into this. Do you want to make this an issue for tracking?