incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1187051 - in /incubator/accumulo/trunk/src: server/src/main/java/org/apache/accumulo/server/tabletserver/ start/src/main/java/org/apache/accumulo/start/
Date Thu, 20 Oct 2011 21:11:41 GMT
Author: ecn
Date: Thu Oct 20 21:11:40 2011
New Revision: 1187051

URL: http://svn.apache.org/viewvc?rev=1187051&view=rev
Log:
ACCUMULO-24: detect when the garbage collector is struggling, and log a warning. Include the
cache size in the initial memory check.

Modified:
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java
    incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/Main.java

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1187051&r1=1187050&r2=1187051&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Thu Oct 20 21:11:40 2011
@@ -208,6 +208,7 @@ public class TabletServer extends Abstra
   
   private static HashMap<String,Long> prevGcTime = new HashMap<String,Long>();
   private static long lastMemorySize = 0;
+  private static long gcTimeIncreasedCount;
   private static AtomicLong scanCount = new AtomicLong();
   private static final Class<? extends LoggerStrategy> DEFAULT_LOGGER_STRATEGY = RoundRobinLoggerStrategy.class;
   
@@ -266,6 +267,15 @@ public class TabletServer extends Abstra
     }
     
     long mem = rt.freeMemory();
+    if (maxIncreaseInCollectionTime == 0) {
+      gcTimeIncreasedCount = 0;
+    } else {
+      gcTimeIncreasedCount++;
+      if (gcTimeIncreasedCount > 3 && mem < rt.totalMemory() * 0.05) {
+        log.warn("Running low on memory");
+        gcTimeIncreasedCount = 0;
+      }
+    }
     
     if (mem > lastMemorySize) {
       sawChange = true;

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java?rev=1187051&r1=1187050&r2=1187051&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java
Thu Oct 20 21:11:40 2011
@@ -130,9 +130,9 @@ public class TabletServerResourceManager
     _dCache = new LruBlockCache(dCacheSize, blockSize);
     
     Runtime runtime = Runtime.getRuntime();
-    if (!usingNativeMap && maxMemory > runtime.maxMemory()) {
-      throw new IllegalArgumentException(String.format("Maximum tablet server map memory
%,d is too large for this JVM configuration %,d", maxMemory,
-          runtime.maxMemory()));
+    if (!usingNativeMap && maxMemory + dCacheSize + iCacheSize > runtime.maxMemory())
{
+      throw new IllegalArgumentException(String.format("Maximum tablet server map memory
%,d and block cache sizes %,d is too large for this JVM configuration %,d",
+          maxMemory, dCacheSize + iCacheSize, runtime.maxMemory()));
     }
     runtime.gc();
     if (!usingNativeMap && maxMemory > runtime.freeMemory()) {

Modified: incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/Main.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/Main.java?rev=1187051&r1=1187050&r2=1187051&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/Main.java (original)
+++ incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/Main.java Thu
Oct 20 21:11:40 2011
@@ -90,7 +90,7 @@ public class Main {
           } catch (Exception e) {
             System.err.println("Thread \"" + Thread.currentThread().getName() + "\" died
" + e.getMessage());
             e.printStackTrace(System.err);
-            throw new RuntimeException(e);
+            System.exit(1);
           }
         }
       };



Mime
View raw message