You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Jack Klebanoff (JIRA)" <de...@db.apache.org> on 2005/03/23 21:10:34 UTC

[jira] Commented: (DERBY-176) Derby throws ERROR XBCM1: Java linkage error thrown during load of generated class org.apache.derby.exe.aced07c066x0102xca87x3319x00004aa5686e1 during execution of large query

     [ http://issues.apache.org/jira/browse/DERBY-176?page=comments#action_61425 ]
     
Jack Klebanoff commented on DERBY-176:
--------------------------------------

I think that there are 3 approaches to solving the problem of the Derby code generator exceeding JVM class size limits:
1. Reduce the amount of code that is generated.
2. Split oversized generated methods into multiple methods.
3. Split oversized generated classes into multiple classes.
We may want (need) to use all three.

We may be able to reduce the amount of generated code by looking for common sub-expressions in the optimized query tree and putting the code for them in separate methods. Or we may be able to reuse intermediate result sets. Perhaps just sharing code for equivalent ProjectResrictNodes and SubQueryNodes would be enough.

Splitting generated classes may be difficult. Derby assumes that each statement only generates one class. It might be possible to put the byte code for the overflow classes into saved objects of the generated ExecPreparedStatement. The main generated class would load the byte code when needed.

> Derby throws ERROR XBCM1: Java linkage error thrown during load of generated class org.apache.derby.exe.aced07c066x0102xca87x3319x00004aa5686e1 during execution of large query
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-176
>          URL: http://issues.apache.org/jira/browse/DERBY-176
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.0.2.0, 10.0.2.1, 10.0.2.2, 10.1.0.0
>     Reporter: Kathey Marsden
>     Assignee: Kathey Marsden

>
> When executing a large query or oather large operations, Derby throws a java linkage exception.
> This is because the generated byte code exceeds the JVM limits for method sizes constant pool entries etc, the amount of code in a conditional etc.  The attached repro demonstrates the problem but the problem can also occur for other operations that generate lots of byte code.  The repro is just a new functional test,
> so should be copied to derbyTesting/functionTests/lang/largeCodeGen.java and run like
>  java -Djvmflags=-Xmx512M org.apache.derbyTesting.harness.RunTest lang/largeCodeGen
> When this problem is fixed additional scenarios should be added to this test.
> ERROR XBCM1: Java linkage error thrown during load of 
> generated class org.apache.derby.exe.aced07c066x0102xca87x3319x00004aa5686e1.
> 	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:315)
> 	at org.apache.derby.impl.services.reflect.DatabaseClasses.loadGeneratedClass(DatabaseClasses.java:162)
> 	at org.apache.derby.impl.services.bytecode.GClass.getGeneratedClass(GClass.java:59)
> 	at org.apache.derby.impl.sql.compile.ExpressionClassBuilder.getGeneratedClass(ExpressionClassBuilder.java:920)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:270)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:432)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:688)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:118)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java:82)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java:62)
> 	at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java:92)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:675)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:519)
> 	at org.apache.derbyTesting.functionTests.tests.lang.largeCodeGen.main(largeCodeGen.java:86)
> Exception in thread "main" 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira