Hi,

I am using gRPC v1.17.2 for implementing CLI for my process. The gRPC 
server is in C++ and the client is in Golang. 

The protobuf definition looks like this

message GetResponseMsg {

  repeated GetResponse           response   = 1;    // response

}

message GetResponse {

  Spec         spec       = 1;

  Status       status     = 2;

  Stats        stats      = 3;

}


Each Response is probably around 500 Bytes in size all considered. The 
number of responses I am trying to retrieve runs to about 200000.


The server implementation looks like this


Status

Get(ServerContext *context,

                 const GetRequestMsg *req,

                 GetResponseMsg *rsp)

{

    uint32_t    i, nreqs = req->request_size();


    for (i = 0; i < nreqs; i++) {

        auto request = req->request(i);

        get(request, rsp->add_response());

    }


    return Status::OK;

}


Obviously with the size of each response and the number of responses I 
expect a lot of memory usage but thought the memory should be recovered 
after this command is run. But this memory is never recovered and I rapidly 
run out of memory and my process crashes. 


I enabled usage of Arena in the proto file but that didn't change anything. 
Is there anything I need to add to free up the memory used after the CLI 
command is run? 


I am a newbie to gRPC so am sorry if I have missed out on anything simple! 
Any help is appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/5dbf9eaa-b684-4c17-bce7-eb4834c1f9e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to