Closed satya-devloper closed 1 year ago
These seem like perfectly normal memory allocation hotspots. The package shouldn’t be retaining any pointers to these objects… what are you doing with the messages yourself?
Once I got the message from connection , I m unmarsahlling it to proto type and then send it to kafka write
So functionality is somewhat like this fun read() { reqprotomsgtype := &pb.msgType{} byteArrayMesssage := conn.read()
proto.Unmarshal(bytearrayMessage, reqprotomsgtype)
senditToKafka(reqprotomsgtype) }
func sendItToKafka(msg){ byte := proto.marsahl(msg.Data) kafka.write(byte, topic) }
I agree with @puellanivis assessment, that there shouldn't be a memory leak on the protobuf side of things. So, perhaps the memory is retained somewhere else in the program. I'm closing this as long as there's no reproducer available.
Using Library : google.golang.org/protobuf version : 1.26.0 go version 1.19
In my code I am creating multiple websocket connection and sending multiple proto message On receive of each message on websocket connection, doing proto.Unmarshal
And When I enable profiling , I can see the profiling looks like.
Is there any memory leak while doing proto.unmarshal and proto.marshal ? As I can see the numbers on arrow used to get increased and never decreased when I stop sending message also. Please suggest some fix