Generated Code Exceeds Java Limits

Generated Code Exceeds Java Limits

book

Article ID: KB0073660

calendar_today

Updated On:

Products Versions
TIBCO Streaming 7.x, 10.x

Description

There are cases when the generated Java code exceeds Java limits and module compilation will fail with an exception like:

2019-09-12 10:46:28.206-0300 [main] ERROR com.streambase.sb.sbd.SBD - CompilationException: Runtime exception: ExecutionException: JaninoRuntimeException: Code of method "fieldMethod0(Lcom/streambase/sb/Tuple;Lcom/streambase/sb/runtime/CaptureManager;Lcom/streambase/sb/runtime/RuntimeEnv;[Lcom/streambase/sb/Schema$Field;Lcom/streambase/cache/SharedDataClass_5F37CC335F409A45CED2D8EB5E0BDDBF;)V" of class "com.streambase.cache.translationUtils_5F37CC335F409A45CED2D8EB5E0BDDBF" grows beyond 64 KB

The typical cause of this failure is a very large schema definition, or an operator (Map/Filter/Query) that evaluates many large expressions.
 

Environment

All supported platforms

Resolution

When this error occurs these system properties can be used to force the generated code to be refactored to work-around the Java limits:
System PropertyValuesDescription
streambase.codegen.allow-refactoringtrue to enable refactoring, false to disable. Default value is false.Enable refactoring.
streambase.codegen.n-stmts-limitPositive integer > 1. Default value is 300.Maximum number of statements in a block. streambase.codegen.allow-refactoring must be true.
In 7.7.x, these properties could be included in .sbconf:
<java-vm>
    <sysproperty name="streambase.codegen.allow-refactoring" value="true"/>
    <sysproperty name="streambase.codegen.n-stmts-limit" value="200"/>
</java-vm>
For 10.x, when launching the fragment from studio, these are set on the Advanced tab of a Studio launch configuration:
-Dstreambase.codegen.allow-refactoring=true
-Dstreambase.codegen.n-stmts-limit=200
-Dstreambase.codegen.broken-method-names=<Comma-separated list of fully-qualified-method-name:refactor-value or simple-method-name:refactor-value values>
 The refactor-value must be less than the value of streambase.codegen.n-stmts-limit. Maximum number of statements in a block for a specific method.
For more details on these settings, please refer to the Help under Home > StreamBase References > StreamBase Java Properties

Issue/Introduction

There are cases when the gnerated Java code exceeds Java limits and module compilation will fail