mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-26 10:32:58 +01:00
Problem: enormous memory increase due to zero copy decoding
The zero copy decoding strategy implemented for 4.2.0 can lead to a large increase of main memory usage in some cases (I have seen one program go up to 40G from 10G after upgrading from 4.1.4). This commit adds a new option to contexts, called ZMQ_ZERO_COPY_RECV, which allows one to switch to the old decoding strategy.
This commit is contained in:
@@ -44,7 +44,7 @@ class v2_decoder_t :
|
||||
public decoder_base_t<v2_decoder_t, shared_message_memory_allocator>
|
||||
{
|
||||
public:
|
||||
v2_decoder_t (size_t bufsize_, int64_t maxmsgsize_);
|
||||
v2_decoder_t (size_t bufsize_, int64_t maxmsgsize_, bool zero_copy_);
|
||||
virtual ~v2_decoder_t ();
|
||||
|
||||
// i_decoder interface.
|
||||
@@ -62,6 +62,7 @@ class v2_decoder_t :
|
||||
unsigned char msg_flags;
|
||||
msg_t in_progress;
|
||||
|
||||
const bool zero_copy;
|
||||
const int64_t maxmsgsize;
|
||||
|
||||
v2_decoder_t (const v2_decoder_t &);
|
||||
|
||||
Reference in New Issue
Block a user