Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/697#discussion_r78648192 --- Diff: core/sql/langman/LmRoutineJavaObj.cpp --- @@ -192,6 +192,7 @@ LmResult LmRoutineJavaObj::invokeRoutineMethod( (*emitRowPtr_)(NULL,0,&qs); } } + jni->DeleteLocalRef(jniResult); --- End diff -- First, sorry for having caused this memory leak and thank you for fixing it! One question: The code saves data members of the jniResult object in returnedIIL_ and returnedPIL_. Is it legal to destroy the local ref to the Java ReturnInfo object and to keep using local refs to the strings and byte arrays stored in it? If it's not, or if it's questionable, then we could save this local ref in the LmRoutineJavaObj object and clean it up on the next call or in the destructor, like we do it for returnedIIL_. If you like I'd be happy to code this and send you a patch.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---