Github user mtaylor commented on the issue:
https://github.com/apache/activemq-artemis/pull/2401
> @michaelandrepearce @mtaylor Ok, just to make sure I understand this,
what we have today:
>
> ```
> <global-max-size>-1</global-max-size>
> ```
> would be equivalent to:
>
> ```
> #
> <accumulative-max-size>-1</accumulative-max-size>
> ```
> Which would give the same 1/2 JVM heap as the max size.
Let's separate out the two use cases.
1. Let the broker choose suitable numbers for the total memory size. Which
is what the global-max-size=-1 does here. Currently it's set at 0.5 x heap
size.
2. Allow flow of management messages when all your memory utilisation for
your client address space is exhausted.
1. I would suggest we leave the setting as it is. But I don't like the -1
setting here. As we use this to mean OFF in other places of the config.
Something like 100% would be better.
2. I think there are two ways of looking at the problem, reserving
capacity, restricting usage. They both solve the original use case but come
from different ends. What I originally meant was restrict usage, i.e. prevent
other address spaces from taking up all the resources. This is inline with the
address size setting. To do this, you can set the size in terms of memory or
as a percentage of the overall memory size (inline with the setting from 1.).
For your use case you could do:
foo.#
<accumulative-max-size>90%</accumulative-max-size>
bar.#
<accumulative-max-size>-1</accumlative-max-size> // i.e. off.
This essentially means, restrict the foo.# address space to 90% of the
overall capacity, ensuring that 10% is always available for the bar.#
addresses. At some point though, it is possible to hit that global-max-size
limit, which is really there to protect the broker from serious problems, like
OOM.
bar.#
<accumulative-max-size>-1</accumulative-max-size>
>
> And to avoid restrictions on activemq.management we would set:
>
> ```
> #
> <accumulative-max-size>-1</accumulative-max-size>
>
> activemq.management
> <accumulative-max-size>0</accumulative-max-size> <!-- unbounded? -->
> ```
> What would be a bit odd is the following:
>
> ```
> foo.#
> <accumulative-max-size>-1</accumulative-max-size>
>
>
> bar.#
> <accumulative-max-size>-1</accumulative-max-size>
> ```
> Perhaps `-1` should only be allowed once, alternatively only on "#"?
---