Our app, one request creates one actor in any one partition, and for processing of one request Memory increasing 200MB-250MB during execution of actor, and after execution is finished I have deleted the actor
Task.Run(() =>
{
actorObject.ExecuteGrainAsync(requestId, jsonModel).ContinueWith(async (t) =>
{
await GrainFactory.DeleteActor(actorObject.GetActorId(), "Workflow", CancellationToken.None);
});
});
IActorService myActorServiceProxy = ActorServiceProxy.Create(
new Uri($"fabric:/APPSeConnect.WebAgent/{actorName}"), actorId);
await myActorServiceProxy.DeleteActorAsync(actorId, cancellationToken);
There are no active actors in partition which we can check by querying the fabric, but still the memory is blocked many minutes(5min - more than 50min). Later exe memory size decreases just few MB.
According to this Document memory should be claimed by runtime in idealtimeout. My setting is
new ActorGarbageCollectionSettings(10, 2)
I am using this attribute too
[StatePersistence(StatePersistence.None)]
During parallel processing of actors it's impact is huge.
We have been facing similar issue as yours, where the Actor Service is not removing its claimed memory in 15 minutes.
The test case is like :
DeleteActorAsyncAPI as mentioned by you.But in our case the whole of the memory is getting released in at least 30 minutes time. Which makes us think probably it is because of Generations of GC collection.