fresh-borzoni commented on code in PR #430:
URL: https://github.com/apache/fluss-rust/pull/430#discussion_r2900669760
##########
crates/examples/src/example_table.rs:
##########
@@ -15,6 +15,10 @@
// specific language governing permissions and limitations
// under the License.
+#[cfg(not(target_env = "msvc"))]
+#[global_allocator]
+static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
Review Comment:
The root cause here is glibc ptmalloc2 fragmenting on repeated same-size
alloc/free, not GC pressure like in Java. With pre-sizing, each builder
allocates once and fills to exactly DEFAULT_MAX_RECORD, so the pattern is very
clean. jemalloc's size-class bins effectively are a memory pool for this
pattern, freed buffers get reused instantly.
A hand-rolled pool would add complexity for diminishing returns over what
jemalloc already provides.
Documenting it is standard Rust practice (DataFusion, TiKV, etc.), and it's
opt-in (docs + examples only).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]