[GitHub] MarvinLitt commented on a change in pull request #3118: [CARBONDATA-3281] limit the LRU cache size

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] MarvinLitt commented on a change in pull request #3118: [CARBONDATA-3281] limit the LRU cache size

GitBox
MarvinLitt commented on a change in pull request #3118: [CARBONDATA-3281] limit the LRU cache size
URL: https://github.com/apache/carbondata/pull/3118#discussion_r253286538
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/cache/CarbonLRUCache.java
 ##########
 @@ -67,6 +67,13 @@ public CarbonLRUCache(String propertyName, String defaultPropertyName) {
     } catch (NumberFormatException e) {
       lruCacheMemorySize = Integer.parseInt(defaultPropertyName);
     }
+
+    //if lru cache is bigger than jvm max memory then set to default size
+    if (isBeyondMaxMemory()){
+      LOGGER.info("LRU cache " + lruCacheMemorySize + "MB is beyond jvm max size, use default " + defaultPropertyName +" MB");
+      lruCacheMemorySize = Integer.parseInt(defaultPropertyName);
 
 Review comment:
   what we use for default is "-1"

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


With regards,
Apache Git Services