Repository navigation
Conversation
vlsi
force-pushed
the
codex/calcite-7985-release-class-bytes
branch
from
December 4, 2026 15:37
967f429 to
e1e1e19
Compare
…eir bytecode on the heap A cached Bindable keeps its defining loader alive. Janino's loader retains the original class files after defining the generated classes. Use a Calcite loader for Janino compilations without an active security manager. Release each byte array after successful definition and keep pending definitions available for companions that load later. Reported-by: Austin Richardson Generated-by: OpenAI Codex
vlsi
force-pushed
the
codex/calcite-7985-release-class-bytes
branch
from
December 4, 2026 16:33
e1e1e19 to
9569bb7
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Jira Link
CALCITE-7985
Changes Proposed
A cached Bindable keeps its defining loader alive. Janino’s loader keeps the original class-file byte arrays on the heap after the JVM defines those classes.
For Janino compilations without an active security manager, use a Calcite-owned loader that releases each byte array after
defineClasssucceeds. It keeps pending companion definitions available for lazy loading. Other compiler providers and compilations with an active security manager use the compiler’s loader. The new loader delegates resource lookups to its parent, consistent with Janino 3.1.12’s behavior for generated class files.Reproduction
I ran Austin Richardson’s 20,000-query repro on Calcite 1.42.0 with and without the equivalent loader patch. Both runs used Janino 3.1.12, Corretto 21.0.9, G1,
-Xms128m -Xmx512m, and-Dcalcite.bindable.cache.maxSize=100000. The table shows post-full-GC measurements in MiB.With the Bindable cache disabled, all 20,000 Bindable loaders unloaded in both runs by the final GC.