mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-24 09:12:30 +02: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:
@@ -206,6 +206,7 @@ zmq::socket_base_t::socket_base_t (ctx_t *parent_,
|
||||
options.socket_id = sid_;
|
||||
options.ipv6 = (parent_->get (ZMQ_IPV6) != 0);
|
||||
options.linger.store (parent_->get (ZMQ_BLOCKY) ? -1 : 0);
|
||||
options.zero_copy = parent_->get (ZMQ_ZERO_COPY_RECV);
|
||||
|
||||
if (thread_safe) {
|
||||
mailbox = new (std::nothrow) mailbox_safe_t (&sync);
|
||||
|
||||
Reference in New Issue
Block a user