Skip to content

[C++] Enable Arrow to share an application's jemalloc instance #32058

@asfimport

Description

@asfimport

Is there any good way for an application that uses Arrow to tell Arrow to share its own jemalloc instance?

Normally when Arrow uses jemalloc, it creates its own instance of it. The only method that I think would work to get Arrow to use the same jemalloc instance as the application would be to do something hacky like this:

  • Patch cpp/src/arrow/memory_pool.cc to use the application's jemalloc header

  • Configure the application's jemalloc instance to use the same configuration that Arrow uses, as shown in je_arrow_malloc_conf

  • Patch ThirdpartyToolchain.cmake to use the application's jemalloc instance

    Is there any non-hacky way to achieve this? If not, would it be possible to add a feature to Arrow to enable the user to tell it to use a specific jemalloc instance at runtime?

    The benefit of this would be that a unified jemalloc instance could (at least hypothetically) allocate memory more efficiently than two separate ones running on the same machine.

Reporter: Ian Cook / @ianmcook
Assignee: Kouhei Sutou / @kou

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-16717. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions