Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cpp/pixels-retina/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ find_package(Java REQUIRED)
find_package(JNI REQUIRED)

# --- Jemalloc Configuration ---
option(ENABLE_JEMALLOC "Enable jemalloc with pixels_ prefix" ON)
option(ENABLE_JEMALLOC "Enable jemalloc for pixels-retina" ON)
include(ExternalProject)

if(ENABLE_JEMALLOC)
Expand All @@ -33,7 +33,6 @@ if(ENABLE_JEMALLOC)
URL https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${JEMALLOC_INSTALL_DIR}
--with-jemalloc-prefix=je_
--enable-prof
--enable-stats
--enable-shared
Expand Down
4 changes: 2 additions & 2 deletions cpp/pixels-retina/lib/RGVisibilityJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,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 (je_mallctl("epoch", NULL, NULL, &epoch, sizeof(uint64_t)) != 0) {
if (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 (je_mallctl("stats.allocated", &allocated, &sz, NULL, 0) != 0) {
if (mallctl("stats.allocated", &allocated, &sz, NULL, 0) != 0) {
return -3;
}

Expand Down
Loading