hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/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:07 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 dfb015d68 -> 8fa491e70
  refs/heads/branch-1.0 aea69c137 -> d443c7096


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/d443c709
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d443c709
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d443c709

Branch: refs/heads/branch-1.0
Commit: d443c7096fced912b8d0cc5c63f9f013762e6122
Parents: aea69c1
Author: Andrew Purtell <apurtell@apache.org>
Authored: Tue Mar 17 15:06:44 2015 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Mar 18 12:08:44 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/d443c709/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 115b3dc..48791a9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.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.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.net.InetSocketAddress;
@@ -2055,7 +2056,9 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
           // Remove lease while its being processed in server; protects against case
           // where processing of request takes > lease expiration time.
           lease = regionServer.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 totalCellSize = 0;
 


Mime
View raw message