-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
Akka version: 1.3.6
Akka.Remote: 1.3.6 (with DotNetty 0.4.6)
Platform: .Net Framework 4.7
Project link: https://github.com/iris4865/IssueStorages/tree/master/AkkaRemote_1.3.6/ActorSelection
Server memory usage has increased When Client program connects and disconnects. At the start of the program, the memory was 35.85MB. ActorSelection test result increased to 1.88GB. I did profiling with JetBrains DotMemory 2018.1. I think that Dotnetty.Buffers is not garbage collected.
- Start Server program with Akka.Remote.
- Client program connects to Server through Akka.Remote.
- Client program sends the message to Server.
- Server program reply to the Client program after processing the message.
- Client program prints the result and exit.
- Multiple clients repeat 2~5.
- Memory usage has increased.
- dotMemory profiling: https://github.com/iris4865/IssueStorages/raw/master/AkkaRemote_1.3.6/ActorSelection/ActorSelection-Akka1.3.6-DotNetty0.4.6.dmw
- server code
namespace AkkaSelectionNettyEnvServer
{
class Program
{
static void Main(string[] args)
{
ActorSystem system = ActorSystem.Create("Server");
system.ActorOf(Props.Create(() => new HelloActor()), "HelloActor");
system.WhenTerminated.Wait();
}
}
public class HelloActor : ReceiveActor
{
public HelloActor()
{
Receive<string>(value =>
{
Console.WriteLine(value);
});
}
}
}
- client code
namespace AkkaSelectionNettyEnvClient
{
class Program
{
static void Main(string[] args)
{
try
{
ActorSystem system = ActorSystem.Create("Client");
var actor = system.ActorSelection("akka.tcp://Server@192.168.100.99:8083/user/HelloActor")
.ResolveOne(TimeSpan.FromSeconds(10))
.Result;
actor.Tell("Hello");
system.Terminate();
}
catch(Exception)
{
}
}
}
}
- client executer code
class Program
{
static void Main(string[] args)
{
if (args.Length == 0)
ExecuteLoop("AkkaSelectionNettyEnvClient.exe");
else
ExecuteLoop(args[0]);
}
public static void ExecuteLoop(string filename)
{
ProcessStartInfo info = new ProcessStartInfo()
{
FileName = filename,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
};
while (true)
{
List<Process> pList = new List<Process>
{
Process.Start(info),
};
foreach (var p in pList)
{
p.WaitForExit();
p.Dispose();
}
pList = null;
}
}
}
p.s
I think Akka version 1.1.3 (with Akka.Remote 1.1.3 and Helios 2.1.2) is no problem.
so I am using version 1.1.3 temporarily.