Hi,

I'm using protobuf in golang programming language.Currently I'm hunting for 
some memory issue and used pprof tool to check heap usage of my program.
Proto message is created in function and returned then in main neverending 
loop is sent to channel to sent data.

I create heap snapshot using pprof tool and looks like even memory to 
message is not referenced buffer of message size is still occupied (I used 
message payload like ~10M to be more visible).

code snippet:
func createMessage([]byte buff) []byte {
   m := &protocol.Message{
Application: "1",
Payload:       buff,
}
  s, err := proto.Marshal(m)
  return m
}


func main() {
   ....
   for {
     select {
     case buff := receivedData:
         p := createMessage(buff)
         dataTosend <- p
     }
   }
}

Am I doing something wrong here? Program work fine but when using payload 
like 100M (on embedded device) I'm getting after few attempts out of memory 
issue.

Thanks.

BR,

marek

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/41b9689d-f0b8-49ab-8475-aaea5271bcb7%40googlegroups.com.

Reply via email to