[zeromq-dev] ZMQ Message Size Limitations
Pieter Hintjens
ph at imatix.com
Fri Apr 11 19:46:49 CEST 2014
Well, yes, running in a debugging and getting a real stack dump
instead of "Killed" is useful. Considering the theoretical causes of a
crash is somewhat like examining the head of a pin for angels.
If you look at s_send() you will see it copies the memory, so the
following free is hardly likely to be a problem.
In any case if you're working in C I recommend you rapidly learn and
use CZMQ, it will save you time.
-Pieter
On Fri, Apr 11, 2014 at 6:34 PM, Mark Hotchkiss
<mark.hotchkiss at yahoo.com> wrote:
> But I would think that it would be killed almost instantly if that was the
> case. It runs for like 20 to 30 minutes before it is killed.
>
> I don't background any of these processes and the taskvent process runs for
> a long time before I get the command prompt back even when it completes all
> of the jobs with a smaller message. And the the ~93% of memory usage (using
> UNIX "top" command) is very consistent until it is killed. So I don't think
> that is the problem.
>
> Here is another possibility for you to consider. We are constructing a new
> message in the Ventilator in each cycle inside the loop:
>
> for (task_nbr = 0; task_nbr < numberOfJobs; task_nbr++) {
>
> // Stuff a character array with a bunch of AAAAA
> // characters of quantity based on messageSize
> unsigned char *p = (unsigned char *) malloc(
> messageSize * sizeof(unsigned char));
> memset((void *) p, 'A', messageSize);
> p[messageSize - 1] = '\0';
>
> // Send the message and reclaim memory
> s_send(sender, p);
> free(p);
> }
>
> Notice that the last two lines of code, I am sending the message and
> immediately calling "free()" after sending. Do you think it is possible that
> the memory is being freed too soon before the message completes sending?
>
> In the meantime, I am going to run this in a debugger to see where it is
> actually crashing.
>
> Mark
> On Friday, April 11, 2014 12:29 AM, Pieter Hintjens <ph at imatix.com> wrote:
> Mark,
>
>> 3. In window #3: ./taskvent 5000 23000000 (jobs, messageSize in bytes)
>> After a
>> while, prior to completion, window #3 (taskvent) will display the word
>> "Killed" and the process will stop without further action.
>
> Perhaps it's consuming too much memory for a single process and then
> being killed by the OS?
>
> 5000 x 2.3 MB = 11 500 MB.
>
>
> -Pieter
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list