activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Nin <>
Subject Understanding memoryUsage (once again!)
Date Fri, 16 Nov 2012 17:29:00 GMT

After some heavy digging about Producer Flow control and the systemUsage
properties a couple of years ago, I thought I quite understood it.
But yesterday I found that one of my configs was not behaving exactly as I
expected, so started doing some tests, and I see certain behaviours which
don't seem to match what the docs and posts that I find on the list or
other forums say.

"storeUsage" is perfectly clear, it's the max space that persistent
messages can use to be stored in disk.
"tempUsage"" applies to file cursors on non-persistent messages, so as to
flush to disk if memory limits are reached (I don't care much about this
one anyway, I always use persistent messages).

Now, according to most posts, memoryUsage would be the maximum memory that
the broker would be available to use.
On this post:
says that "memoryUsage corresponds to the amount of memory that's
assigned to the in-memory store".

For example, on my tests using the following config (only showing relevant

<policyEntry queue=">" producerFlowControl="false" optimizedDispatch="true">
        <individualDeadLetterStrategy queuePrefix="DLQ."
useQueueForQueueMessages="true" />

            <memoryUsage limit="100 mb"/>
            <storeUsage limit="1 gb" name="foo"/>
            <tempUsage limit="3 gb"/>

With that config I would expect the broker to use 100 mb of maximum memory
among all queues. So it could maybe use 30mb in one queue and 70mb in
second queue.

1) What I'm seeing is that if I start feeding a queue without consuming it,
the "Memory percent used" grows up to 70%, after that it doesn't grow
What is it doing exactly there? The first 70% is stored in memory (apart
from disk since it's persistent), and all the rest that continues being fed
goes just to disk?

2) If then I start feeding a 2nd queue, "Memory percent used" continues
growing until it reaches 140%. So it looks like memoryUsage does not apply
globally, but on a per queue basis?
Using memoryLimit on the queue's policyEntry gives more control over this,
but it's just a variation, "Memory percent used" can grow more than 100%

3) If #2 is true, then how would I prevent the broker from running out of
memory in case queues would continue to be created?

Maybe I'm misunderstanding and some of these settings make no sense when
producerFlowControl is disabled?

Thanks in advance.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message