-
Notifications
You must be signed in to change notification settings - Fork 807
Description
We're using gRPC to transfer large messages over the network, around 150MB each. I've noticed that in the client processes this tends to generate quite large, lasting memory footprints. This matters to us, because we run this on a k8s cluster: So I want to make sure the memory usage after receiving and digesting such a message is minimal. These messages are only exchanged once a day (at night), so we prefer lower memory consumption over speed.
I wrote a small test solution based on the Greeter app that illustrates this: https://github.com/efrainsteinbach/grpc-client-memory-test
It's simply requesting five messages sequentially which should be around ~200MB in size (uncompressed). After the five requests are through, the Gen2 Heap allocation stays at 400MB, even though I'm doing my best to dispose of any references I may still have to any gRPC components:
To me it looks as if some singleton or static components of Grpc.Net.Client or Grpc.Core are somehow holding to the last received message. (?)
Am I doing something wrong? Is there a way to clean this up?
(I tried explicitly shutting down and disposing the channel already)