db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1300785 - in /db/derby/code/branches/10.7: ./ java/engine/org/apache/derby/impl/sql/execute/ java/testing/org/apache/derbyTesting/functionTests/tests/memory/
Date Wed, 14 Mar 2012 23:29:40 GMT
Author: kmarsden
Date: Wed Mar 14 23:29:40 2012
New Revision: 1300785

URL: http://svn.apache.org/viewvc?rev=1300785&view=rev
Log:
DERBY-3009 Out of memory error when creating a very large table

Contributed by Knut Anders Hatlen. Merge revision 1086527 from trunk


Added:
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby3009Test.java
      - copied unchanged from r1086527, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby3009Test.java
Modified:
    db/derby/code/branches/10.7/   (props changed)
    db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java

Propchange: db/derby/code/branches/10.7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 14 23:29:40 2012
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.8:1209227-1209228,1209284
-/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1069661,1071463,1071886,1076335,1076387,1078461,1078608,1078693,1081072,1081455,1081568,1085078,1091000,1097247,1103681,1103718,1128243,1129136,1130632,1130895,1131272,1132664,1136363,1138341,1138444,1139449,1141924,1164370,1203050,1207729,1208775,1209228,1243878,1293494,1294512,1294522,1295085
+/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1069661,1071463,1071886,1076335,1076387,1078461,1078608,1078693,1081072,1081455,1081568,1085078,1086527,1091000,1097247,1103681,1103718,1128243,1129136,1130632,1130895,1131272,1132664,1136363,1138341,1138444,1139449,1141924,1164370,1203050,1207729,1208775,1209228,1243878,1293494,1294512,1294522,1295085

Modified: db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=1300785&r1=1300784&r2=1300785&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
(original)
+++ db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Wed Mar 14 23:29:40 2012
@@ -272,6 +272,22 @@ class AlterTableConstantAction extends D
 
 	// INTERFACE METHODS
 
+    /**
+     * Run this constant action.
+     *
+     * @param activation the activation in which to run the action
+     * @throws StandardException if an error happens during execution
+     * of the action
+     */
+    public void executeConstantAction(Activation activation)
+            throws StandardException {
+        try {
+            executeConstantActionBody(activation);
+        } finally {
+            clearState();
+        }
+    }
+
 	/**
 	 *	This is the guts of the Execution-time logic for ALTER TABLE.
 	 *
@@ -279,7 +295,7 @@ class AlterTableConstantAction extends D
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-    public void executeConstantAction(Activation activation)
+    private void executeConstantActionBody(Activation activation)
             throws StandardException {
         // Save references to the main structures we need.
         this.activation = activation;
@@ -627,6 +643,23 @@ class AlterTableConstantAction extends D
 		}
 	}
 
+    /**
+     * Clear the state of this constant action.
+     */
+    private void clearState() {
+        // DERBY-3009: executeConstantAction() stores some of its state in
+        // instance variables instead of local variables for convenience.
+        // These variables should be cleared after the execution of the
+        // constant action has completed, so that the objects they reference
+        // can be garbage collected.
+        td = null;
+        lcc = null;
+        dd = null;
+        dm = null;
+        tc = null;
+        activation = null;
+    }
+
 	/**
 	 * Update statistics of either all the indexes on the table or only one
 	 * specific index depending on what user has requested.

Modified: db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java?rev=1300785&r1=1300784&r2=1300785&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
(original)
+++ db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
Wed Mar 14 23:29:40 2012
@@ -40,6 +40,7 @@ public class _Suite extends BaseJDBCTest
         suite.addTest(ClobMemTest.suite());
         suite.addTest(MultiByteClobTest.suite());
         suite.addTest(RolesDependencyTest.suite());
+        suite.addTest(Derby3009Test.suite());
         suite.addTest(MemoryLeakFixesTest.suite());
         suite.addTest(XAMemTest.suite());
         return suite;



Mime
View raw message