Skip to content

[CSDK] Release JNI local references in Configuration - #4406

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

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

Conversation

@QiuYucheng2003

Copy link
Copy Markdown

Summary

  • Delete the temporary jstring arguments in Configuration::get and Configuration::set.
  • Store the Hadoop Configuration class and instance as global refs, and release them in the destructor.
  • Pass Configuration into CarbonSchemaReader::readSchema by reference so the destructor runs once.

Fixes #4403

Test plan

  • Rebuild sdk/CSDK
  • Call Configuration::set repeatedly and confirm the JNI local reference table no longer grows

get and set leaked two local refs per call. Configuration now stores
the Hadoop Configuration class and instance as global refs and releases
them in its destructor.
Fixes apache#4403

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.

CSDK Configuration leaks JNI local refs in get/set and stores FindClass/NewObject without NewGlobalRef

1 participant