Hello! I think I've stumbled across an issue similar to this one:
https://github.com/protocolbuffers/protobuf/issues/10088But I'm not entirely sure, so seeking help.
I've forked and hacked together a little demo repo:
https://github.com/viktorvorobev/proto_leakBut basically the situation is as follows.
If you create a proto object, then use `ParseFromString` on it multiple times, then the object size grows uncontrollably until this object is deleted:
obj = schema_pb2.value_test_topic()
for _ in range(10_000_000):
# here the object will grow
obj.ParseFromString(b"...")
del obj
But if you recreate an object every time, then everything seems to be fine, so this code doesn't leak:
for _ in range(10_000_000):
obj = schema_pb2.value_test_topic()
obj.ParseFromString(b"...")
I suspect the same behaviour for Unpack, but didn't test it myself.
Is this known or intended?
Thanks a lot!