we are using golang 1.16. for developing a microservice which exports product data to shopify. the microservice is starting a grpcserver. our java client starts the export of the items via calling the endpoint "SendAllItems" on grpc Server. then the endpoint reads 20.000 Products from database, convert them into json objects and send them to shopify.
we see now the strange behaviour that on linux the memory usage of the service increases to 8 GB and it gets not released any more. when we profile the service we see it uses round about 70 MB.
pprof:
we already added at the end of function the command debug.FreeOSMemory() and tried to set all slices which could use too much memory to nil after usage but no chance to decrease the memory. the only thing which takes effect is to restart the whole grpcserver.