You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Bharath Kumar Suresh <sb...@gmail.com> on 2021/11/01 22:28:27 UTC
Not able to set off heap max memory for Ignite queues
Hello,
I'm trying to set a maximum limit on the memory (not in terms of the number
of elements) of an ignite queue using
CollectionConfiguration::setOffHeapMaxMemory
<https://github.com/apache/ignite/blob/5c189a932d53a5c971d859b6ecd1098ad1da831c/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java#L157>.
The snippet below is how I try to achieve the same:
CollectionConfiguration queueConfiguration = new
CollectionConfiguration();
queueConfiguration.setOffHeapMaxMemory(DataSize.ofMegabytes(2L).toBytes());
ignite.queue("test-queue", 0, queueConfiguration);
As seen above, I set the cap parameter to 0 since I want to define the size
of the queue in terms of actual memory (2MB in the above example) and not
the number of elements in the queue.
But somehow this setting doesn’t restrict the actual size of the queue.
What am I missing? Could someone please help?
Thanks,
Bharath