Integrated: 8300024: Replace use of JNI_COMMIT mode with mode 0

Daniel Jeliński djelinski at openjdk.org
Mon Jan 16 07:02:16 UTC 2023


On Thu, 12 Jan 2023 09:23:49 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> Please review this patch that fixes a few memory leaks in JNI code.
> 
> [The latest documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#releaseprimitivetypearrayelements-routines) of JNI functions makes an explicit note about the use of JNI_COMMIT:
> 
>> If `JNI_COMMIT` is passed as the `mode` argument when `elems` is a copy of the elements in `array`, then a final call to *Release<PrimitiveType\>ArrayElements* passing a `mode` argument of "0" or `JNI_ABORT`, should be made to free the `elems` buffer
> 
> No new regression test. I manually verified the Linux fix using ClhdsbPstack test in root mode. Also, tier1-2 tests on mach5 continue to pass.

This pull request has now been integrated.

Changeset: 50e7df91
Author:    Daniel Jeliński <djelinski at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/50e7df91c77d436937fff9134174ddb8a8dd4dd7
Stats:     8 lines in 4 files changed: 0 ins; 0 del; 8 mod

8300024: Replace use of JNI_COMMIT mode with mode 0

Reviewed-by: amenkov, sspitsyn, cjplummer

-------------

PR: https://git.openjdk.org/jdk/pull/11963


More information about the serviceability-dev mailing list