Search code examples
memorygarbage-collectionignitein-memory-database

Ignite large query stores data in memory even when onHeapCacheEnabled is set to false


I am running ignite 2.3 in embedded mode which means my default mode of data storage is off-heap. I have not enabled on heap cache.

The problem is when I run a large query, the data is stored ON the heap for a long time before it finally garbage collects. Is this expected? Why does it take so long for JVM to garbage collect this data.

I am concerned because as a result of my query, and the data it occupies on heap this will affect my application performance.

My CacheConfiguration are as follows:

  • data region max size: 12288000000L
  • CacheMode.LOCAL
  • indexedType

Solution

  • Ignite always stores data off-heap, on-heap caching is a feature that gives you ability to use Java heap as a cache for off-heap memory and configure eviction policies specific to this cache.

    So, the data that you observe on Java heap with onHeapCacheEnabled=false is not Ignite cache data in your case, but a Java application memory footprint which is absolutely expected to exist. If you are experiencing application peformance issues that are connected with GC, check Preparing for Production and namely Garbage Collection Tuning sections of Ignite documentation for tuning tips or ask any specific questions here.

    Regards.