db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1298765 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
Date Fri, 09 Mar 2012 09:27:43 GMT
Author: kahatlen
Date: Fri Mar  9 09:27:43 2012
New Revision: 1298765

URL: http://svn.apache.org/viewvc?rev=1298765&view=rev
Log:
DERBY-5642: OutOfMemoryError in OCRecoveryTest on phoneME

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java?rev=1298765&r1=1298764&r2=1298765&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java Fri Mar
 9 09:27:43 2012
@@ -549,6 +549,13 @@ public abstract class BaseTestCase
             if (emmaactive != null)
                 cmdlist.add("-Demma.active=" + emmaactive);            
 	    }
+
+        if (isCVM()) {
+            // DERBY-5642: The default maximum heap size on CVM is very low.
+            // Increase it to prevent OOME in the forked process.
+            cmdlist.add("-Xmx32M");
+        }
+
 	    cmdlist.add("-classpath");
 	    cmdlist.add(getSystemProperty("java.class.path"));
 	    for (int i =0; i < cmd.length;i++) {
@@ -625,12 +632,20 @@ public abstract class BaseTestCase
     }
 
     /**
+     * Check if this is a CVM-based VM (like phoneME or Oracle Java ME
+     * Embedded Client).
+     */
+    public static boolean isCVM() {
+        return "CVM".equals(getSystemProperty("java.vm.name"));
+    }
+
+    /**
      * Check if the VM is phoneME.
      *
      * @return true if it is phoneME
      */
     public static boolean isPhoneME() {
-        return getSystemProperty("java.vm.name").equals("CVM") &&
+        return isCVM() &&
                 getSystemProperty("java.vm.version").startsWith("phoneme");
     }
 



Mime
View raw message