I want to understand how cadence-client manages memory for long running workflows. Consider that a workflow runs for 6 months, but it is not active for this entire duration. It becomes active when the client receives a signal related to this workflow, performs some activities and then again become idle. I am using Workflow.await
method given by java library to acheive this.
My question is how does cadence manage these idle workflows(and all the state variables that this workflow creates)? Since the workflow has not completed yet, will it allow java garbage collector to remove the classes related to the workflow or will they remain in the heap space consuming memory and CPU? Can we remove the idle workflows from memory so that our memory footprint does not increase ?