PNE-8934: Fix native memory leak in EcosSolve JNI wrapper - #25
Merged
Conversation
…releasing the 10 read-only input array pins that were previously never freed. Bumps to 0.0.14.
andyczerwonka
requested review from
anoto-moniz,
jamie-heller,
mVenetos97 and
wjohnald
July 29, 2026 19:50
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.
Java_io_citrine_ecos_NativeECOS_EcosSolvepinned 11 JVM arrays viaGet*ArrayElementsbut only released 1 (the output). The 10 input pins were leaked on every solve, in my tests around ~5.75 KB of native RSS per call, JVM heap was flat.See https://citrineinformatics.slack.com/archives/C06MVKFPYPR/p1785346491886009 for more context.
I confirmed with a local test in Mithril as per @mVenetos97 idea: long story short, we had linear RSS growth on the old version, and now near-flat after this fix. Uses JNI_ABORT since the inputs are read-only, which cheaper than mode 0 and semantically identical here. Releases sit on both the success and failure paths.
Bumps to 0.0.14.