[zeromq-dev] Improving zeromq in OOM conditions
Paul Colomiets
paul at colomiets.name
Sun May 15 20:43:44 CEST 2011
Hi,
As Martin encouraged me to fix zeromq in out of memory conditions. Here are
first patches and first questions.
There are a lot of explicit and implicit (e.g. inserting in STL container)
memory allocations in consturctors in zeromq code. As long as we are
encouraged not to use exceptions in zeromq code, we can't gracefully
propagate exceptions from there. So I see three options:
1. Refactor code to have all the memory allocations in `init()` method
(other name?)
2. Allow throwing and catching exceptions in code which is not on critical
path
3. Move memory allocation code to overriden `new` (which will probably turn
it into a mess)
BTW, if catching exceptions is discouraged at all, we need to rewrite all
code which uses STL containers.
Thoughs?
--
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110515/ae930ceb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-zmq_msg_init_data-returns-ERRNO-instead-aborting.patch
Type: application/octet-stream
Size: 1228 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110515/ae930ceb/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Better-handling-of-memory-error-in-resolve_ip_hostna.patch
Type: application/octet-stream
Size: 1364 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110515/ae930ceb/attachment-0001.obj>
More information about the zeromq-dev
mailing list