[GitHub] xuchuanyin 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] xuchuanyin commented on a change in pull request #3118: [CARBONDATA-3281] limit the LRU cache size

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

 ##########
 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:
   So are you sure that the default value will not exceed the JVM heap size here? I think it may be a problem here!

----------------------------------------------------------------
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