The most common idiom is that you have a server that just creates one arena
per request. When the request comes in, it creates an arena and uses that
throughout the processing of the request, and then destroys it once it is
done with that request. I think re-using a single Arena in multiple
long-lived threads is more unusual. In your case, is there any way to
structure things so that there is a clearly delineated request lifetime
that matches the arena lifetime?

On Sat, Dec 2, 2017 at 11:55 PM, kino <[email protected]> wrote:

> Hi all,
>
> I am using proto.buf (C++) with Arena (its my first time).
>
> I have two linux processes (multi threaded) exchanging different types of
> msgs (proprietary protocols in an embedded environment)
>
> When I print the arena used Space I can see the memory size increasing
> (obliviously).
>
> One process could retrieve space after it has “consumed” the last incoming
> message but as far as I understood the only way it is to call the Reset()
> method on Arena obj forcing me to synchronize the threads with the process.
>
> Does exist  a different idiom to re-claim memory avoiding the thread
> synchronization?
>
> Has arena a sort of automatic “garbage collector”?
>
> In the scenario above what do you suggest in order to keep the memory
> consumed by proto.buf under control ?
>
> Thanks in advance.
>
> --
> 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 post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to