diff --git a/cpp/pixels-retina/CMakeLists.txt b/cpp/pixels-retina/CMakeLists.txt index d6fdda101..e643430fd 100644 --- a/cpp/pixels-retina/CMakeLists.txt +++ b/cpp/pixels-retina/CMakeLists.txt @@ -33,6 +33,7 @@ if(ENABLE_JEMALLOC) URL https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 CONFIGURE_COMMAND /configure --prefix=${JEMALLOC_INSTALL_DIR} + --with-jemalloc-prefix=je_ --enable-prof --enable-stats --enable-shared @@ -51,7 +52,6 @@ if(ENABLE_JEMALLOC) add_dependencies(jemalloc_lib jemalloc_ext) add_definitions(-DENABLE_JEMALLOC) - add_definitions(-DJEMALLOC_MANGLE) endif() # Disable gtest installation @@ -93,10 +93,19 @@ add_library(pixels-retina SHARED ${SOURCES}) set_target_properties(pixels-retina PROPERTIES OUTPUT_NAME "pixels-retina" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + # Set the rpath to the current directory, so that the jemalloc library can be found at runtime + INSTALL_RPATH "$ORIGIN" + BUILD_RPATH "$ORIGIN" ) target_link_libraries(pixels-retina PRIVATE ${JNI_LIBRARIES}) +# Disable rpath +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) +set_target_properties(pixels-retina PROPERTIES + INSTALL_RPATH_USE_LINK_PATH FALSE +) + if(ENABLE_JEMALLOC) target_link_libraries(pixels-retina PRIVATE jemalloc_lib pthread dl) if(UNIX) diff --git a/cpp/pixels-retina/lib/RGVisibilityJni.cpp b/cpp/pixels-retina/lib/RGVisibilityJni.cpp index d97d5c720..ff655f8a7 100644 --- a/cpp/pixels-retina/lib/RGVisibilityJni.cpp +++ b/cpp/pixels-retina/lib/RGVisibilityJni.cpp @@ -155,13 +155,13 @@ JNIEXPORT jlong JNICALL Java_io_pixelsdb_pixels_retina_RGVisibility_getNativeMem // 1. Try to refresh jemalloc epoch to ensure stats are current. // Return -2 if this fails, as defined in Java's handleMemoryMetric. - if (mallctl("epoch", NULL, NULL, &epoch, sizeof(uint64_t)) != 0) { + if (je_mallctl("epoch", NULL, NULL, &epoch, sizeof(uint64_t)) != 0) { return -2; } // 2. Try to read the actual allocated bytes. // Return -3 if this fails, which often implies a config/prefix mismatch. - if (mallctl("stats.allocated", &allocated, &sz, NULL, 0) != 0) { + if (je_mallctl("stats.allocated", &allocated, &sz, NULL, 0) != 0) { return -3; } diff --git a/pixels-common/src/main/resources/pixels.properties b/pixels-common/src/main/resources/pixels.properties index 0558df643..dbb18f564 100644 --- a/pixels-common/src/main/resources/pixels.properties +++ b/pixels-common/src/main/resources/pixels.properties @@ -269,6 +269,8 @@ memspl = [1,8,16,32,64] # set to true to enable pixels-retina retina.enable=false +# number of rows in each tile visibility, must be a multiple of 64 +retina.tile.visibility.capacity=10240 # number of rows recorded in memTable, must be a multiple of 64 retina.buffer.memTable.size=10240 # the scheme of the storage for retina buffer object storage, e.g., s3, minio diff --git a/pixels-retina/pom.xml b/pixels-retina/pom.xml index d391f9651..f17e8b27a 100644 --- a/pixels-retina/pom.xml +++ b/pixels-retina/pom.xml @@ -15,7 +15,6 @@ 1.8 1.8 UTF-8 - 10240 @@ -163,11 +162,14 @@ run - + + + + - +