-
Notifications
You must be signed in to change notification settings - Fork 11.1k
grpc 1.8.3 may have memory leak when works on windows #13941
Description
Should this be an issue in the gRPC issue tracker?
YES
What version of gRPC and what language are you using?
grpc 1.8.3 from nuget, C#
What operating system (Linux, Windows, …) and version?
windows server 2012 R2
What runtime / compiler are you using (e.g. python version or version of gcc)
.net framework 4.5
If possible, provide a recipe for reproducing the error. Try being specific and include code snippets if helpful.
client stub call a server doesn't exists or the service on server doesn't start.
full code at:
https://github.com/luchunminglu/LearnNotes_Unimport/tree/master/Tests/GrpcMemoryLeakTest/
static void Main(string[] args)
{
//for this test, the server doesn't exists or the server doesn't listen on the port
String ip = "192.168.163.19";
int port = 5678;
while (true)
{
List<Task> tasks = new List<Task>();
for (int i = 0; i < 5; i++)
{
tasks.Add(Task.Factory.StartNew(() => {TestGrpc(ip,port);}));
}
Task.WaitAll(tasks.ToArray());
Thread.Sleep(1000);
}
}
private static void TestGrpc(String ip, int port)
{
Channel channel = null;
try
{
channel = new Channel(ip, port, ChannelCredentials.Insecure);
Greeter.GreeterClient client = new Greeter.GreeterClient(channel);
Response resp = client.SayHello(new Request(), deadline: DateTime.UtcNow.AddSeconds(5));
}
catch (Exception e)
{
// exception will happen because of this is no such server
Console.WriteLine("error=" + e);
}
finally
{
if (channel != null)
{
channel.ShutdownAsync().Wait(9000);
}
}
}
What did you expect to see?
the client's memory is steady
What did you see instead?
when use grpc 1.8.3, memory increases overtime. but memory use seems steady when when use grpc 1.7.1.