Can you create a compilable self contained C++ file including
proto-file (stripped down to the essentials) with the essence of your
code which would make it simpler (for you and people on the list) to
verify if there is a problem ?
Also, I would probably not use protocol buffers as values within
vectors (esp. if they're big - this advice is true for any bigger
object) because you implicitly might call copy constructors if you
resize() the vector and it has to realloc. Rather allocate protos on
the heap (new/delete). This allows for further improvements later,
like having a pool of pre-allocated protobuffers.
-h
>
>
> I have checked that the messages are properly queued and dequeued, the
> size of the vector does not increase and stay constant (usually 0
> since the message is consumed right away)
>
> At this point I am thinking that this way of erasing may be causing
> the leak. From the STL documentation I gather that the vector::erase
> method is supposed to call the destructor for each element... Is this
> good enough to free all the memory allocated for the message?
>
> Any other idea why this memory leak is happening?
>
> Jean-Sebastien
>
>
> --
> You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
> To post to this group, send email to prot...@googlegroups.com.
> To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
>
>