Hi there

We have an issue with increasing memory usage of an application using 
Protobuf. The application has been tested with Valgrind in Ubuntu to find 
the reason for this increase. The results shown with Massif Visualiser is 
shown below:


Here is a snapshot of the part of code highlighted by Valgrind:


The figure is suggesting that the issue is related to Protobuf library 
functions, and further studies of the source code have strongened these 

Here are the functions in ProtobufReceiver:

void ProtobufReceiver::runClient() 


        string receivedData;



                string tmpData;

                *socket >> tmpData;

                receivedData += tmpData;




bool ProtobufReceiver::parseContent(string &receivedData){

    if(dataSize >= packetSize)    {        DataList *dl = new DataList();       
 string dataString = receivedData.substr(packetSize-messageSize, messageSize);  
        if(dataSize > packetSize)        {           retval = true;           
receivedData = receivedData.substr(packetSize);        }        else        {   
        receivedData.clear();        }


The DataList is the protobuf message, and even though this is not seen deleted 
here, it has been verified that every object is correctly deleted later in a 
getMessage() function.

The memory usage has been shown to increase up to values of around 1GB, before 
flattening out (increases at an almost negligible rate). At this stage, the 
program behaviour still seems normal.
No crashes have been observed because of this, but it would still be nice to 
figure out the reason for this behaviour. 

Also, a strange thing is that when running the program on a newer version of 
the HP EliteBook series, the issue seems to not appear. The program has been 
runned on a few other computers 
(mine is an EliteBook 8740w), on both Windows 7 and Ubuntu, with the same 
memory issues. I guess this could imply that the issue is HW dependant.

We are using Protobuf version 2.4.1.

Does anybody have a clue what's going on here? Any feedback would be 


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 http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to