hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [2/2] hbase git commit: HBASE-13269 Limit result array preallocation to avoid OOME with large scan caching values
Date Wed, 18 Mar 2015 23:22:08 GMT
HBASE-13269 Limit result array preallocation to avoid OOME with large scan caching values


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8fa491e7
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8fa491e7
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8fa491e7

Branch: refs/heads/0.98
Commit: 8fa491e709770ca73701adeb474807ec87b421af
Parents: dfb015d
Author: Andrew Purtell <apurtell@apache.org>
Authored: Tue Mar 17 15:05:46 2015 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Mar 18 16:21:46 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/HRegionServer.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8fa491e7/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index edb799c..2e088df 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.regionserver;
 
 import java.io.IOException;
 import java.io.InterruptedIOException;
+import java.lang.Math;
 import java.lang.Thread.UncaughtExceptionHandler;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -3237,7 +3238,9 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
           // Remove lease while its being processed in server; protects against case
           // where processing of request takes > lease expiration time.
           lease = leases.removeLease(scannerName);
-          List<Result> results = new ArrayList<Result>(rows);
+          // Limit the initial allocation of the result array to the minimum
+          // of 'rows' or 100
+          List<Result> results = new ArrayList<Result>(Math.min(rows, 100));
           long currentScanResultSize = 0;
           long totalKvSize = 0;
 


Mime
View raw message