From e3803319d9578e976e90b5cf05c99dc3d7063551 Mon Sep 17 00:00:00 2001 From: Alessandro Bellina Date: Fri, 3 Feb 2023 12:21:31 -0600 Subject: [PATCH] Remove child fom newCudaAsyncMemoryResource (#12681) Fixes a bug introduced here https://github.com/rapidsai/cudf/pull/12632 where the C++ version of the jni call `Rmm.newCudaAsyncMemoryResource` was taking an extra argument (`child`), causing the `threshold` to be set to a random value since the calling code defined the native method has taking 2 longs, not 3. The above can affect performance if the threshold is set to 0 for example. The async pool will reduce its footprint by releasing memory, which means we need to go back and reallocate. This is how I found it. I am starting the build process for this, so it's going to take me a bit to test. Authors: - Alessandro Bellina (https://github.com/abellina) Approvers: - Jason Lowe (https://github.com/jlowe) URL: https://github.com/rapidsai/cudf/pull/12681 --- java/src/main/native/src/RmmJni.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/java/src/main/native/src/RmmJni.cpp b/java/src/main/native/src/RmmJni.cpp index 1ce69414c98..5bbb5383d93 100644 --- a/java/src/main/native/src/RmmJni.cpp +++ b/java/src/main/native/src/RmmJni.cpp @@ -549,10 +549,8 @@ JNIEXPORT void JNICALL Java_ai_rapids_cudf_Rmm_releaseArenaMemoryResource(JNIEnv } JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Rmm_newCudaAsyncMemoryResource(JNIEnv *env, - jclass clazz, - jlong child, jlong init, + jclass clazz, jlong init, jlong release) { - JNI_NULL_CHECK(env, child, "child is null", 0); try { cudf::jni::auto_set_device(env); auto ret = new rmm::mr::cuda_async_memory_resource(init, release);