db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1301628 - in /db/derby/code/branches/10.5/java: engine/org/apache/derby/impl/sql/execute/ testing/org/apache/derbyTesting/functionTests/tests/memory/
Date Fri, 16 Mar 2012 16:17:23 GMT
Author: kmarsden
Date: Fri Mar 16 16:17:23 2012
New Revision: 1301628

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

Contributed by Knut Anders Hatlen. Manual Merge revision 1086527 from trunk 

Added:
    db/derby/code/branches/10.5/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.5/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=1301628&r1=1301627&r2=1301628&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Fri Mar 16 16:17:23 2012
@@ -269,6 +269,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.
 	 *
@@ -276,7 +292,7 @@ class AlterTableConstantAction extends D
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public void	executeConstantAction(
+	public void	executeConstantActionBody(
     Activation activation)
         throws StandardException
 	{
@@ -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.5/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java?rev=1301628&r1=1301627&r2=1301628&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
(original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
Fri Mar 16 16:17:23 2012
@@ -42,6 +42,7 @@ public class _Suite extends BaseJDBCTest
         suite.addTest(RolesDependencyTest.suite());
         suite.addTest(MemoryLeakFixesTest.suite());
         suite.addTest(XAMemTest.suite());
+        suite.addTest(Derby3009Test.suite());
         return suite;
     }
 }



Mime
View raw message