We have a mechanism to limit the memory used by a process. To make sure that there are no violators, we rely on maxrss of the process. We check maxrss every few mins to see if we had seen a spike in memory which was beyond the permitted value.
We have a grpc server and what we are seeing is that for a request with 4MB of payload, the maxrss of the process is becoming slightly greater than 8MB. This limits our effective memory utilization to just half in most of the scenario without violating the memory limit. My guess it that this is because grpc is not zero copy. Is there a way to make grpc zero copy? If not, is there a way to limit the spike in memory when multiple requests come in?