Hi,

I generate a huge number of the same messages and save them one by one in a 
file. Each message is generated and then saved on the fly. This way I do not 
keep in memory large array of messages, only one at a time. Everything works 
fine. The largest message written is about 2K (serialized string size).

Then I read these messages one by one from the file and use. I keep only one 
message in memory at a time again. Everything works fine if I have, say 
~10e4 messages.

Once the number of saved messages is increased to something like 10e6 then I 
get warnings from ProtoBuf, like:

libprotobuf WARNING google/protobuf/io/coded_stream.cc:478] Reading 
dangerously large protocol message.  If the message turns out to be larger 
than 67108864 bytes, parsing will be halted for security reasons.  To 
increase the limit (or to disable these warnings), see 
CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.

and then:

libprotobuf ERROR google/protobuf/io/coded_stream.cc:147] A protocol message 
was rejected because it was too big (more than 67108864 bytes).  To increase 
the limit (or to disable these warnings), see 
CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.

What might be wrong?


Here is my code (it is very short and simple):

Message: http://goo.gl/mzmTB

Write executable: http://goo.gl/SH41R
Writer (Output Wrapper): http://goo.gl/Fr0Rf

Read executable: http://goo.gl/UpC5i
Reader (Input Wrapper): http://goo.gl/zAeuU

The errors/warnings start if one changes 1e4 to 1e6 at: http://goo.gl/1IBZS

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to