Skip to content

Large Payload Unary Calls: Unable to clean up after useΒ #1267

@efrainsteinbach

Description

@efrainsteinbach

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:

image

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions