Ignite's memory consumption

classic Classic list List threaded Threaded
2 messages Options
danami danami
Reply | Threaded
Open this post in threaded view
|

Ignite's memory consumption

Hi all Igniters,

I am trying to minimize Ignite's memory consumption on my server. 

Some background:
My server has 16GB RAM, and is supposed to run applications other than Ignite.
I use Ignite to store a cache. I use the TRANSACTIONAL_SNAPSHOT mode and I don't use persistence (configuration file attached). To read and update the cache I use SQL queries, through ODBC Client in C++ and through an embedded client-mode node in C#. 
My data consists of a table with 5 columns, and I guess around tens of thousands of rows.  
Ignite metrics tell me that my data takes 167MB ("CFGDataRegion region [used=167MB, free=67.23%, comm=256MB]", This region contains mainly this one cache).

At the beginning, when I didn't tune the JVM at all, the Apache.Ignite process consumed around 1.6-1.9GB of RAM.
After I've done some reading and research, I use the following JVM options which have brought the process to consume around 760MB as of now:
-J-Xms512m
-J-Xmx512m
-J-Xmn64m
-J-XX:+UseG1GC
-J-XX:SurvivorRatio=128
-J-XX:MaxGCPauseMillis=1000
-J-XX:InitiatingHeapOccupancyPercent=40
-J-XX:+DisableExplicitGC
-J-XX:+UseStringDeduplication

Currently Ignite is up for 29 hours on my server. When I only started the node, the Apache.Ignite process consumed around 600MB (after my data insertion, which doesn't change much after), and as stated, now it consumes around 760MB. I've been monitoring it every once in a while and this is not a sudden rise, it has been rising slowly but steadily ever since the node has started.
I used DBeaver to look into node metrics system view, and I turned on the garbage collector logs. The garbage collector log shows that heap is constantly growing, but I guess this is due to the SQL queries and their results being stored there. (There are a few queries in a second, the results normally contain one row but can contain tens or hundreds of rows). After every garbage collection the heap usage is between 80-220MB. This is in accordance to what I see under HEAP_MEMORY_USED system view metric. Also, I can see that NONHEAP_MEMORY_COMITTED is around 102MB and NONHEAP_MEMORY_USED is around 98MB.

My question is, what could be causing the constant growth in memory usage? What else consumes memory that doesn't appear in these metrics?

Thanks for your help!

ignite-config.xml (8K) Download Attachment
Mikhail Mikhail
Reply | Threaded
Open this post in threaded view
|

Re: Ignite's memory consumption

512M of heap, plus 512M of offheap, plus some space for java metaspace, if you don't set, it is unlimited, set to: -XX:MaxMetaspaceSize=256m

so, in total it will consume up to 1.25GB.
But even with what you described, I don't see any problem 760MB is less than limits you set to heap+off-heap.

ср, 26 авг. 2020 г. в 09:17, Dana Milan <[hidden email]>:
Hi all Igniters,

I am trying to minimize Ignite's memory consumption on my server. 

Some background:
My server has 16GB RAM, and is supposed to run applications other than Ignite.
I use Ignite to store a cache. I use the TRANSACTIONAL_SNAPSHOT mode and I don't use persistence (configuration file attached). To read and update the cache I use SQL queries, through ODBC Client in C++ and through an embedded client-mode node in C#. 
My data consists of a table with 5 columns, and I guess around tens of thousands of rows.  
Ignite metrics tell me that my data takes 167MB ("CFGDataRegion region [used=167MB, free=67.23%, comm=256MB]", This region contains mainly this one cache).

At the beginning, when I didn't tune the JVM at all, the Apache.Ignite process consumed around 1.6-1.9GB of RAM.
After I've done some reading and research, I use the following JVM options which have brought the process to consume around 760MB as of now:
-J-Xms512m
-J-Xmx512m
-J-Xmn64m
-J-XX:+UseG1GC
-J-XX:SurvivorRatio=128
-J-XX:MaxGCPauseMillis=1000
-J-XX:InitiatingHeapOccupancyPercent=40
-J-XX:+DisableExplicitGC
-J-XX:+UseStringDeduplication

Currently Ignite is up for 29 hours on my server. When I only started the node, the Apache.Ignite process consumed around 600MB (after my data insertion, which doesn't change much after), and as stated, now it consumes around 760MB. I've been monitoring it every once in a while and this is not a sudden rise, it has been rising slowly but steadily ever since the node has started.
I used DBeaver to look into node metrics system view, and I turned on the garbage collector logs. The garbage collector log shows that heap is constantly growing, but I guess this is due to the SQL queries and their results being stored there. (There are a few queries in a second, the results normally contain one row but can contain tens or hundreds of rows). After every garbage collection the heap usage is between 80-220MB. This is in accordance to what I see under HEAP_MEMORY_USED system view metric. Also, I can see that NONHEAP_MEMORY_COMITTED is around 102MB and NONHEAP_MEMORY_USED is around 98MB.

My question is, what could be causing the constant growth in memory usage? What else consumes memory that doesn't appear in these metrics?

Thanks for your help!