Skip to content

[CSDK] Release JNI local references in CarbonWriter - #4405

Open
QiuYucheng2003 wants to merge 1 commit into
apache:masterfrom
QiuYucheng2003:fix-carbonwriter-jni-local-ref
Open

QiuYucheng2003 wants to merge 1 commit into
apache:masterfrom
QiuYucheng2003:fix-carbonwriter-jni-local-ref

Conversation

@QiuYucheng2003

Copy link
Copy Markdown

Summary

  • Delete temporary JNI local refs in CarbonWriter builder APIs.
  • Keep CarbonWriter, CarbonWriterBuilder, and CarbonWriter instances as global refs and release them in close().
  • Use java/lang/String in sortBy, and delete each column string after it is stored in the array.

Fixes #4402

Test plan

  • Rebuild sdk/CSDK
  • Call sortBy with a large column list and confirm it no longer hits "JNI local references exceeded"

sortBy kept one local ref per sort column and could overflow the JNI
local reference table. Builder objects are now global refs and are
released in close().
Fixes apache#4402

Signed-off-by: qiuyucheng <qiuyucheng@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JNI local reference leak in CarbonWriter (sortBy can overflow local ref table)

1 participant