[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-dev
Subject:    Re: ActiveMQ CPP library - limit on number of connections/threads
From:       Timothy Bish <tabish121 () gmail ! com>
Date:       2017-08-25 23:07:37
Message-ID: 1a76cc45-2b74-2889-f501-05c91b854738 () gmail ! com
[Download RAW message or body]

On 08/25/2017 06:58 PM, duncant wrote:
> I did some more digging on this in the decaf code.
>
> The error message is coming from this code in ThreadLocalImpl.cpp:
>
> ThreadLocalImpl::ThreadLocalImpl() : tlsKey(0) {
>      tlsKey = Threading::createThreadLocalSlot(this);
>
>      if (tlsKey < 0) {
>          throw RuntimeException(
>              __FILE__, __LINE__, "Thread Local storage limit reached.");
>      }
> }
>
> So looking at createThreadLocalSlot, in Threading.cpp I see:
>
>      ...stuff...
>      for (index = 0; index < DECAF_MAX_TLS_SLOTS; index++) {
>          if (library->tlsSlots[index] == NULL) {
>              library->tlsSlots[index] = threadLocal;
>              break;
>          }
>      }
>      ...stuff...
>      return index < DECAF_MAX_TLS_SLOTS ? index : -1;
>
> So, looks like DECAF_MAX_TLS_SLOTS is what's causing my problem.  This is
> defined in ThreadingTypes.h:
>
>      #define DECAF_MAX_TLS_SLOTS 384
>
>
> Hmmm... 384 is 128 times 3.  So maybe each mq consumer creates 3 threads,
> therefore I'm running out at 128?
> I wonder what will happen if I just increase DECAF_MAX_TLS_SLOTS and
> rebuild.  Right now I'm just blundering around.  I don't suppose there are
> still any decaf developers around?

Increasing the slots will allow for more threadlocal storage at the cost 
of more memory overhead.
Reference -> https://issues.apache.org/jira/browse/AMQCPP-605


-- 
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic