I think you have to destroy the message if you want its memory to be fully released. If I remember right, proto2 messages implement Clear() in a way that does not free submessages, and some projects have used this as an optimization. (You can Clear() and reuse the same message many times and avoid memory allocations.)
On Wed, Mar 11, 2020 at 3:09 AM Gaurav sahil <[email protected]> wrote: > Please find the link aswell, > > > https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.common > > > Is there any other way to deallocate the memory ? > > On Wednesday, March 11, 2020 at 3:36:39 PM UTC+5:30, Gaurav sahil wrote: >> >> Google Protocol Buffer Version - 3.5.x >> >> Usage - Using it to share data between and embeded system and cloud. >> >> Issue - After packetizing the data we use ParentMessage->Clear(); >> function to clear the data. This function is not reducing the memory >> allocated. >> Checked in Google Protocol buffer documentation that the memory allocated >> by new is internally being allocated statically. >> What does statically mean ? Will the memory be available statically even >> after clear. ? >> >> >> -- > 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/7a55044e-a44a-497d-ac02-d35800f2c084%40googlegroups.com > <https://groups.google.com/d/msgid/protobuf/7a55044e-a44a-497d-ac02-d35800f2c084%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CADqAXr6LYn26gTmW4zePougBM%2B5CzgW31Oqtx14wwY0Ac3H6_g%40mail.gmail.com.
