Closed zeke202207 closed 1 year ago
May be just console, it display more lines, use more memory.
May be just console, it display more lines, use more memory.
Even so, when I call the service interface for a long time, I find that the memory is still growing, and there is no decline in reclaim.is this behavior normal? Thank you and look forward to your reply @luchunminglu
I did a test today, the early memory growth rate is very large, after running for a period of time, the memory growth rate is reduced, but the memory is still growing, not always stable or decline.
This is the normal behavior of the .NET GC.
In the client do something like
DateTime start = DateTime.Now;
while (DateTime.Now <= start.AddSeconds(20))
{
for (int i = 0; i < 100; i++)
{
HelloReply reponse = client.SayHello(new HelloRequest() { Name = $"zeke-{i}" });
Console.WriteLine(reponse.Message);
}
}
then -- when the GC determines to run -- the memory usage can drop...see link above.
Under a profiler (the one from VS) it looks on my machine like
The red vertical bars show when the GC kicks in to collect objects. Can also be seen in the "Live Objects" graph above.
Thank you so much @gfoidl
What version of gRPC and what language are you using?
dotnet version 6
Grpc packages:
What operating system (Linux, Windows,...) and version?
Windows 10 [version 10.0.19045.3208]
Scenario
Following the example from the official website, a simple demo was written. I found that grpc-service memory kept going up and not down, even when I closed the calling client, the memory still did not go down