Hi Rob, Is there any way to get more information about the objects it says have leaked?
I'm surprised that your tool is showing objects being freed on exit that aren't freed by deleting outp and calling google::protobuf::ShutdownProtobufLibrary(). I don't think the protobuf library installs any kind of atexit() handlers or anything like that, so anything that's not getting freed by ShutdownProtobufLibrary() and outp probably isn't getting freed by any part of the protobuf library. Also I'd be really surprised if ParseFromArray() was leaking hundreds of objects. If you can get any more information from your memory profiler, it would be easier to help explain what you are seeing. Best, Josh On Wednesday, February 3, 2016 at 1:37:40 PM UTC-8, Rob Jaeger wrote: > > Well, not technically a leak because the memory eventually does get > deleted on exit, but for my every call to ParseFromArray() I'm seeing a few > hundred small allocations which stick around until exit, These add up when > I need to call ParseFromArray() >100k times and cause quite a memory surge > during runtime. I think the vast majority of protobuf users would never > notice this problem. > > google::protobuf::ShutdownProtobufLibrary() does not help. > > Is this a known problem? Is there a way to fully cleanup all temporary > memory allocs during runtime? Am I possibly doing something wrong in my > implementation? > > debug code: > > _CrtMemCheckpoint(&s1); > _CrtMemDumpAllObjectsSince(&s1); // no objects, correct > > bool res = outp.ParseFromArray(outbuf, sz); > > _CrtMemDumpAllObjectsSince(&s1); // hundreds of small (mainly under 100 > byte) objects that survive the destruction of outp. > > TIA -Rob > -- 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 protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.