You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/02/01 12:32:12 UTC

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

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

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/cache/CarbonLRUCache.java
 ##########
 @@ -305,4 +312,15 @@ public void clear() {
       lruCacheMap.clear();
     }
   }
+
+  /**
+   * Check if LRU cache setting is bigger than max memory of jvm.
+   * if LRU cache is bigger than max memory of jvm when query for a big segments table,may cause JDBC server crash.
+   * @return true LRU cache is bigger than max memory of jvm, false otherwise
+   */
+  private boolean isBeyondMaxMemory(){
+    long mSize = Runtime.getRuntime().maxMemory();
+    long lruSize = lruCacheMemorySize * 1024 * 1024;
 
 Review comment:
   better to use BYTE_CONVERSION_CONSTANT instead of 1024 * 1024

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services