Hello!
I met a problem of size increase of my program written in C++.
During investigation I came to a simple piece of code, incapsulated in a {} block, where:
- I create a protobuf message, fill it in with some dummy values.
- get size by calling msg.ByteSizeLong(),
- serialize msg to array of chars allocated to size I got on previous step.
- Immediatelly I call ParseFromArray of another protobuf message of the same type, using same array and size as data source.
- And exit from the code block.
If the number of objects (either repeated or map<>) in the message is big enough, I see that the size of a program grows and never gets smaller.
If repeated the call of block 10 times, or more, the program size gets noticeable big.
I expect that the protobuf message objects do clear used memory at the moment when program exits the {} block from message destructor.
But this does not happen.