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

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

 ##########
 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:
   I feel it is better to consider only 60%  of max memory instead of considering 100%.

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