zstan commented on a change in pull request #7245: IGNITE-12530 Pages list 
cache limit added to prevent IgniteOOME on checkpoint
URL: https://github.com/apache/ignite/pull/7245#discussion_r366811227
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
 ##########
 @@ -118,6 +120,19 @@
  * Used when persistence enabled.
  */
 public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl 
implements DbCheckpointListener {
+    /**
+     * Threshold to calculate limit for pages list on-heap caches.
+     * <p>
+     * Note: When a checkpoint is triggered, we need some amount of page 
memory to store pages list on-heap cache.
+     * If a checkpoint is triggered by "too many dirty pages" reason and pages 
list cache is rather big, we can get
+     * {@code IgniteOutOfMemoryException}. To prevent this, we can limit the 
total amount of cached page list buckets,
+     * assuming that checkpoint will be triggered if no more then 3/4 of pages 
will be marked as dirty (there will be
+     * at least 1/4 of clean pages) and each cached page list bucket can be 
stored to up to 2 pages (this value is not
+     * static, but depends on PagesCache.MAX_SIZE, so if PagesCache.MAX_SIZE > 
PagesListNodeIO#getCapacity it can take
+     * more than 2 pages). Also some amount of page memory needed to store 
page list metadata.
+     */
+    public static final double PAGE_LIST_CACHE_LIMIT_THRESHOLD = 0.1;
 
 Review comment:
   i still have no clue how u define this constant is it really enough to be 
static (not dynamically) calculated here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to