cpp-ipc icon indicating copy to clipboard operation
cpp-ipc copied to clipboard

maximum possible data_length.

Open binary-husky opened this issue 2 years ago • 1 comments

I'm trying to achieve large message ping-pong between 2 processes, but when I set data_length=8*1024*1024, I get struct inside recv call

data_length=7*1024*1024 --> ok data_length=8*1024*1024 --> fail data_length=16*1024*1024 --> fail

I'm trying to implement one side on C++ and the other side on python with pybind11, thereby I'm having trouble to get a traceback, is 8*1024*1024 special in cpp-ipc?

binary-husky avatar Apr 27 '23 15:04 binary-husky

The value of 8*1024*1024 is nothing special in the library. It specifies the size of a single element in the circular buffer, while the buffer size is 255. This means that the total buffer size will be data_length*255, and 8M means the buffer will take up about 2GB of memory. Therefore, you need to check your device to see if the memory is large enough.

mutouyun avatar May 05 '23 06:05 mutouyun